我想用 python 编辑文件(dhcpd.conf、dns 文件)。我正在寻找任何选择,我找到了 bicop 库。我尝试这样做:
from bicop import parse
parse("/home/tigov/dhcp/dhcpd.conf")
我得到了:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/bicop/config.py", line 83, in parse
return _Parse(tokenizer, dictclass=dictclass)
File "/usr/local/lib/python2.6/dist-packages/bicop/config.py", line 141, in _Parse
raise ParseError, (input.infile, input.lineno, "Unexpected end of file")
bicop.config.ParseError: None[1]: Unexpected end of file
任何想法我必须做什么,或任何“bicop 如何”?或者也许另一个图书馆可以做到这一点?(iscpy 库不适合我)感谢您的帮助,对不起,我的英语很弱。