Reading a portion of a file
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Fri Mar 9 19:29:13 EST 2007
En Fri, 09 Mar 2007 11:28:15 -0300, Vulcanius <cmfvulcanius at gmail.com>
escribió:
> Here is the code I've come up with. Please feel free to critique it
> and let me know what you would change. Also, as you can see I call
> "open(SERVER,'r')" twice; but I want to only call it once, what would
> the best way to do this be?
You got yesterday a reply from rune.strand at g... without regexps that looks
pretty functional, have you seen it?
> SECTIONDICT = {}
> for SECT in SECTIONS:
> PRESECTNAME1 = SECT[9:len(SECT) - 1]
> PRESECTNAME2 = PRESECTNAME1.split("/")
Ugh... don't use UPPERCASE names for variables, please!
Better to follow this style guide: http://www.python.org/dev/peps/pep-0008/
--
Gabriel Genellina
More information about the Python-list
mailing list