In article <[EMAIL PROTECTED]>,
Peter A. Schott <[EMAIL PROTECTED]> wrote:
>Been reading the docs saying that file should replace open in our code, but
>this
>doesn't seem to work:
>
># Open file for writing, write something, close file
>MyFile = file("MyFile.txt", "w")
>MyFile.write("This is a test.")
>MyFile.close()
This should work in a sufficiently recent version of python (I'm hedging
because I don't recall when file was introduced -- python 2.2? 2.3?).
What version are you using? What error do you see?
-- Russell
--
http://mail.python.org/mailman/listinfo/python-list