syntax-error?

Erik Max Francis max at alcyone.com
Fri Nov 23 20:22:01 CET 2001


Stefan Antoni wrote:

> I got the following script and it produces a syntax error which drives
> me crazy. it says:
> 
> File "<string>", line 24
>   j = 0 # a counter
>   ^
> SyntaxError: invalid syntax
> 
> Why?
	...
> def ExtractData(in_string, start_line, end_line):
>     lstr = in_string.splitlines()
>         j = 0 # a counter
	...

You have an indentation problem.  The offending line is on a different
indentation level that the line preceding it, but the preceding line
doesn't start a new block.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Laws are silent in time of war.
\__/ Cicero
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list