1 Star 1 Fork 0

orangego / jd_maotai

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
config.py 699 Bytes
一键复制 编辑 原始数据 按行查看 历史
ganlinhao 提交于 2020-06-11 00:28 . first commit
import os
import configparser
class Config(object):
def __init__(self, config_file='config.ini'):
self._path = os.path.join(os.getcwd(), config_file)
if not os.path.exists(self._path):
raise FileNotFoundError("No such file: config.ini")
self._config = configparser.ConfigParser()
self._config.read(self._path, encoding='utf-8-sig')
self._configRaw = configparser.RawConfigParser()
self._configRaw.read(self._path, encoding='utf-8-sig')
def get(self, section, name):
return self._config.get(section, name)
def getRaw(self, section, name):
return self._configRaw.get(section, name)
global_config = Config()
1
https://gitee.com/orangego/jd_maotai.git
git@gitee.com:orangego/jd_maotai.git
orangego
jd_maotai
jd_maotai
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891