juho.schultz at helsinki.fi
Fri Mar 10 15:43:15 CET 2006
> Hi All
> Basically i want to write into a file .If the permissions are not there
> then print a error message.
> How do i achive this ???
One way would be a try-except block, and leave the permission checking
error message generation, etc. to the operating system.
outfile = file(outfilename,"w")
except IOError, errormsg
print "Could not write to file %s: %s" % (outfilename, errormsg)
More information about the Python-list