I'm having a problem with Python 2.6 on windows.
Whether I try:
I get an error:
IOError: [Errno 2] No such file or directory: 'nonexistent.txt'
What may be the problem?
You will not be able to read the file if it does not exist, however, you should be able to write to it. Does the code below return the same error?
f=open("nonexistent.txt","w") f.write('Test') f.close()
At seems like a permission problem. Try opening the file somewhere else or run the python as an Administrator.