[EMAIL PROTECTED] wrote:
> hi,
> how can i skip printing the last line using loops (for /while)
> 
> eg
> 
> for line in open("file):
>      print line.
> 
> I want to skip printing last line of the file.thanks
> 

afile = open(filename)

xlines = afile.xreadlines()

aline = xlines.next
for nextline in xlines:
   print aline
   aline = nextline

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

Reply via email to