Working with Huge Text Files
cwazir at yahoo.com
cwazir at yahoo.com
Sun Mar 20 00:29:52 EST 2005
John Machin wrote:
> More meaningful names wouldn't go astray either :-)
I heartily concur!
Instead of starting with:
fields = line.strip().split(',')
you could use something like:
(f_name, f_date, f_time, ...) = line.strip().split(',')
Of course then you won't be able to use ', '.join(fields[1:])
for the output, but the rest of the program will be
MUCH more readable/maintainable.
Chirag Wazir
http://chirag.freeshell.org
More information about the Python-list
mailing list