> thanks dave, > just tried writing to file for the first time > > def main(): > outfile.write('Hello this is a test') > outfile.close() > main() > > error, globalname outfile is not defined, do i need to import function to get this working? > >
Fyi, you should check the python docs. They have a good introduction if this is the first time. Also its a good idea to use a try block incase the file does not exist and you have to do a bit of error handling.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor