Reading the first line of a file (in a zipfile)

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Apr 11 16:20:30 EDT 2007


En Wed, 11 Apr 2007 17:15:48 -0300, <mike.aldrich at gmail.com> escribió:

> The file contents have leading whitespace, then a number:
>      123456       \n
> I expect to return '123456'

And nothing following the number?

py> line = "     123456       \n"
py> print line.strip()
123456

-- 
Gabriel Genellina



More information about the Python-list mailing list