[Tutor] reading complex data types from text file

Chris Castillo ctcast at gmail.com
Wed Jul 15 20:55:08 CEST 2009


I'm having some trouble reading multiple data types from a single text file.

say I had a file with names and numbers:

bob
100
sue
250
jim
300

I have a few problems. I know how to convert the lines into an integer but I
don't know how to iterate through all the lines and just get the integers
and store them or iterate through the lines and just get the names and store
them.

please help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090715/f434ee78/attachment-0001.htm>


More information about the Tutor mailing list