Gustavo Niemeyer wrote: > The most compeling reason I could see is: > > >>> import ConfigParser > >>> cfg = ConfigParser.ConfigParser(singlesection="shell") > >>> cfg.read("/etc/sysconfig/network-scripts/ifcfg-lo") > >>> cfg.get("shell", "ipaddr") > '127.0.0.1' don't forget that you can subclass stuff in Python: import ConfigParser, StringIO class MyConfigParser(ConfigParser.ConfigParser): def read(self, filename): try: text = open(filename).read() except IOError: pass else: file = StringIO.StringIO("[shell]\n" + text) self.readfp(file, filename) cfg = MyConfigParser() cfg.read("/etc/sysconfig/network-scripts/ifcfg-lo") cfg.get("shell", "ipaddr") </F>
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