[newbie] Writing to file : "name 'concat' is not defined"?

Fred nobody at nowhere.com
Wed Jul 21 09:48:37 EDT 2004


On Wed, 21 Jul 2004 15:31:00 +0200, Brian Quinlan <brian at sweetapp.com>
wrote:
>Think about these two lines of code for a minute...what do you expect 
>"concat" to return? A file object? Maybe this would help:
>
>file = open('test.txt', 'w')
>file.close()
>
>Or, even better (since "file" is a builtin object):
>
>f = open('test.txt', 'w')
>f.close()

Thank you Brian. That solved it :-)

However, the above was just stuff I read on the web:

http://diveintopython.org/file_handling/file_objects.html#d0e15055
http://docs.python.org/tut/node9.html

Thx again
Fred.



More information about the Python-list mailing list