Super-newbie syntax error question

John Machin sjmachin at lexicon.net
Mon Apr 29 04:58:54 EDT 2002


[Charlie Wood]

I have some code that I've cobbled together ...
...and here's the resulting error:
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "C:\PYTHON22\lib\rss2html.py", line 46
     f = file("/article.txt", "w")
     ^
 SyntaxError: invalid syntax

****** You may like to put code that _you_ have cobbled together
somewhere else, reserving c:\python22\lib\ for code that the Python
development team has cobbled together :-)

["Sean 'Shaleh' Perry"]
> Should be:
> 
> f = open() not file().

****** You may like to read "What's New In Python 2.2"



More information about the Python-list mailing list