python四十:configparse模块
生活随笔
收集整理的這篇文章主要介紹了
python四十:configparse模块
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
# 創建配置文檔 import configparserconfig = configparser.ConfigParser()config["DEFAULT"] = {"ServerAliveInterval":"45","Compression":"yes","CompressionLevel":"9" }config['bitbucket.org'] = {} config['bitbucket.org']['User'] = 'hg'config['topsecret.server.com'] = {} topsecret = config['topsecret.server.com'] topsecret['Host Port'] = '55555' topsecret['ForwardXll'] = 'no'with open('example.ini', 'w') as configfile:config.write(configfile)?
總結
以上是生活随笔為你收集整理的python四十:configparse模块的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C十五:数组
- 下一篇: 运算方法和运算部件三