I ran a quick test and on my Windows XP Box it seems to be the file path it balks at. I had to give it the full file path (or at least back to where python.exe sits)
try:
# needs full file path!
OutFile = open("/home/nephish/Test.txt", "w")
OutFile.write("Here is a spot of text to input")
OutFile.close()
print "File successfully written"
except IOError:
print "Cannot open file for writing"
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417