码迷,mamicode.com
首页 > 编程语言 > 详细

Python中i使用ini配置文件

时间:2020-07-06 19:23:32      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:img   nbsp   name   变量   http   获取   python   配置   too   

 

 

 

 技术图片

 

 

import configparser
cf = configparser.ConfigParser() cf.read(‘config.ini‘) # 获取配置文件对象 app_name = cf.get(‘test-client‘, "path") # 读取test-client模块下的path变量 获取到的都是字符串


 

Python中i使用ini配置文件

标签:img   nbsp   name   变量   http   获取   python   配置   too   

原文地址:https://www.cnblogs.com/tarzen213/p/13256325.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!