[newbie] Writing to file : "name 'concat' is not defined"?
brian at sweetapp.com
Wed Jul 21 15:31:00 CEST 2004
> I've searched the web and the archives of this ng for half an
> hour already, and I'm still stuck.
> 1. On a W2K Pro host, installed the latest ActivePython MSI. Rebooted.
> 2. Create test.py with the following:
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')
Or, even better (since "file" is a builtin object):
f = open('test'.txt', 'w')
More information about the Python-list