Newbie Problem

Ralf Doering ralf.doering at prakinf.tu-ilmenau.de
Thu Jul 29 01:56:44 EDT 1999


rbl at hal.cwru.edu writes:

> 
> There is some Python code I've downloaded that I'm trying to run.
> If I just drop the .py file on the Python icon, I get some errors,
> so I am trying to run it interactively for debugging.
> 
> Here is what happened:
> 
> Python 1.5.1 (#37, Apr 27 1998, 13:36:04)  [CW PPC w/GUSI w/MSL]
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import sys
> >>> import random
> >>> import string
> >>> 
> >>> def run(filename=''):
> ... if filename=='':
>   File "<stdin>", line 2
>     if filename=='':
>      ^
> SyntaxError: invalid syntax
> >>> 
> 
> The original code segment is:

[...]

Just indent the "if" statement.

Ralf
-- 
No sig -- no fun




More information about the Python-list mailing list