Why this compile error?

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Fri Mar 19 11:04:11 CET 2010


Jimbo a écrit :
> Hello
> 
> Can you help me figure out why I am getting this compile error with my
> program. The error occurs right at the bottom of my code & I have
> commented where it occurs.
> 
> The error is:
> [QUOTE]Expected an indented block[/QUOTE]
> 
> [CODE]
(snip)
> # Main program loop
> def main():
>     programEnd = False;
> 
>     while (programEnd == False):
>         #ERROR HERE?? - Error="Expected an indented block"

Indeed. You *need* a stamement in the while block. If you want a noop, 
then use the 'pass' statement:

      while programEnd == False:
          pass


But note that as-is, this will go into an infinite loop.



More information about the Python-list mailing list