当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.py 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: UTF-8 -*-
import json
def theme():
conf_z = open("theme.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
thing = "theme"#取xx项
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[thing]
return conf_jg
def config_one(theme,xiang):
theme_c = theme
xiang_c = xiang
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_c]
return conf_jg
def config_two(theme,xiang_one,xiang_two):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c]
return conf_jg
def config_three(theme,xiang_one,xiang_two,xiang_three):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
xiang_three_c = xiang_three
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c][xiang_three_c]
return conf_jg
def config_four(theme,xiang_one,xiang_two,xiang_three,xiang_four):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
xiang_three_c = xiang_three
xiang_four_c = xiang_four
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c][xiang_three_c][xiang_four_c]
return conf_jg
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化