Simple looping question...

Pieter Claerhout Pieter_Claerhout at CreoScitex.com
Mon Apr 2 11:55:03 EDT 2001


Change the code to the following:

    all_lines = fil1.readlines()
    for a in all_lines:
        print a

Kind regards,


Pieter

-----Original Message-----
From: Vincent A. Primavera [mailto:vincent_a_primavera at netzero.net]
Sent: Monday, April 02, 2001 5:04 PM
To: python-list at python.org
Subject: Simple looping question...


Hello,
	In a piece of code similar to this I am trying to read all the lines
from a 
file but no more.  How can I set the "range" of this loop to stop when it 
reaches the end of the file?
              
              for i in range(???):
              a = fil1.readline()
              print a

	Thank You,
	Vincent A. Primavera

-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list