"sudhir prasad" <[email protected]> wrote

how to clear contents of a file with out actually deleting it,

reopening it for write will, clear the contents.
However....

basically wat im trying to do is copy a source file into a common file ,run
the common file,after that  i need to copy another source file  into the
common file,i ant to clear the contents of the common file before copying

This is such a bizarre thing to do that I have to ask why you are doing it?
There are so many ways to execute a piece of source code from
within a python program why on earth are you creating a new file to do so?
There may be a valid reason but I can't think of one. If you describe the
wider problem we may be able to offer an alternative solution that
does not require you to copy the code at all.

--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to