[Tutor] search function
Steve
lonetwin at gmail.com
Fri Jul 30 09:14:34 CEST 2004
Hi Conrad,
> There are a few things that are bugging me about this. One is the heavy
> use of regular expressions, and two is that im using [1.-1] to strip the
> qoutes. Can anyone point out how to make this more pythonic?
The pythonic way to handle this would be to have the ConfigParser
module do all the dirty work:
http://www.python.org/doc/current/lib/module-ConfigParser.html
An example:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65334
An alternate module to essentially do the same thing:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259175
HTH
Steve
More information about the Tutor
mailing list