Testing for EOF ?

Simon Brunning simon.brunning at gmail.com
Mon Apr 4 07:31:49 EDT 2005


On Apr 4, 2005 12:21 PM, Pete Moscatt <pgmoscatt at optushome.com.au> wrote:
> I am reasonably new to python and am trying to read several lines of text
> from an open file.

my_file = open('whatever.txt', 'r')
for line in my_file:
    print line # Or whatever

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list