I must be missing some simple method on a file object or something.

What I need to do is to truncate the first line of a file which has an
unknown number of lines and an unknown size.

The only thing I can think to do is to readlines() and then slice off
the first line in the resulting list, then writelines().

pseduo-code:
my_file = open('file.txt', 'wb')
lines = my_file.readlines()
del lines[0]
my_file.writelines()
my_file.close()

Is there a better way?

/alex
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to