import configparser
def get_conf_parse(path,key,section=None):
"""
:param path: 配置文件的路径
:param key: key
:param section: 段落
:return:
"""
cf = configparser.ConfigParser()
cf.read(path)
value=cf.get(section,key)
return value
if __name__ == '__main__':
get_conf_parse("conf.cfg","static_path","File_Path")