3 Star 1 Fork 3

jillchen / Python.Card

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ReadIniConfig.py 542 Bytes
一键复制 编辑 原始数据 按行查看 历史
jillchen 提交于 2020-01-23 10:24 . first commit
import configparser
import os
class ReadConfig:
"""定义一个读取配置文件的类"""
def __init__(self, filepath=None):
if filepath:
configpath = filepath
else:
root_dir = os.path.dirname(os.path.abspath(__file__))
configpath = os.path.join(root_dir, "./config.ini")
self.cf = configparser.ConfigParser()
self.cf.read(configpath,encoding="utf-8-sig")
def get_config(self, param):
value = self.cf.get("cameraConfig", param)
return value
Python
1
https://gitee.com/yunshuchen/Python.Card.git
git@gitee.com:yunshuchen/Python.Card.git
yunshuchen
Python.Card
Python.Card
master

搜索帮助