我有点卡在
ConfigParser
。
我想向现有部分添加特定设置。
我愿意:
import ConfigParser
Config = ConfigParser.ConfigParser()
Config
Config.read("/etc/yum.repos.d/epel.repo")
Config.sections()
Config.set('epel','priority',10)
with open('/etc/yum.repos.d/epel.repo', 'w') as fout:
然后显示:
...
File "<stdin>", line 2
^
IndentationError: expected an indented block
>>>