Super-newbie syntax error question

Robert Amesz sheershion at mailexpire.com
Mon Apr 29 10:23:14 EDT 2002


Charlie Wood wrote:

> 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


It's probably an indentation error. Alternatively, check the
preceding line carefully. 

To avoid indentation errors
   1 - Use eiter tabs or spaces, and be consistent about it.
   2 - Use the SciTE-editor: it can show indentation levels very
       clearly.

SciTE is also a very nice, albeit somewhat minimalist[*] -
general code editor, and a tiny download at about 350K.
Open source, too. Check http://www.scintilla.org .


Robert Amesz
-- 
[*] A relative term: the syntax colouring is excellent, and you can 
configure it for code completion, and in most cases you can run a 
Python script 'out of the box'. Double clicking on an error in the 
output window will move the cursor instantly to the offending line, 
even if the file isn't loaded at the time. There's more, but this
should suffise. The configuration dialogs *are* minimal, though: there 
are _none_: you'll have to edit the configuration files yourself.



More information about the Python-list mailing list