Hi All,

I need to read parse and re-write the parsed file. I am opening with

f = open(file_rc, 'r+')

reading file ....

f.seek(0)

resetting file pointer ...

print >> f, section

writing smaller file...

and I end up with the remnants of the old larger file at the end.
any idea how to clip the file to the newer smaller size without
closing it and reopening it as a 'w' ?

Cheers

Dave


-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to