Python Error:IndentationError: expected an indented block

Steve Holden steve at holdenweb.com
Wed Nov 8 11:53:08 EST 2006


Antonios Katsikadamos wrote:
> hi all. I try to run an old python code and i get the following message
> 
> File "/home/antonis/db/access.py", line 119
>     def DoCsubnet1 (action, subject, target, args):             # DoC 
> servers net
>       ^
> IndentationError: expected an indented block
> 
> 1) and I don't know what causes it. I would be grate full if you could 
> give me a tip.
> 
Typically you have a line ending in a colon (like an "if" or "for" 
statement) where the next line isn't at a higher indented level.

This is an indication that the code NEVER worked.

> 2) how can i overcome it? Can i use the keyword pass?and if how ccan i 
> use it
> 
You could just blindly add an indented pass statement, but there is of 
course no guarantee this will be what you require.

How long is the code? Would it be practical to publish it here? (If it's 
more than 200 lines assume the answer to that last question is "no").

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list