> > However, in most cases, such files can be easily read with execfile, > > passing an empty dictionary. > > Unfortunately, variables without quotes is a common shell idiom: > > >>> execfile("/etc/sysconfig/network-scripts/ifcfg-lo") > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/etc/sysconfig/network-scripts/ifcfg-lo", line 2 > IPADDR=127.0.0.1 > ^ > SyntaxError: invalid syntax > > (no, I haven't tweaked the file just to show that.. :-) Listen, these files are shell scripts. Any attempts to parse them with other means than feeding them to the shell are doomed. Don't try to tweak ConfigParser to do something it's not good at anyway. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4