[Tutor] executing python script

Remco Gerlich scarblac@pino.selwerd.nl
Thu, 27 Sep 2001 12:53:49 +0200


On  0, Damian Coughlan <d_coughlan@altavista.com> wrote:
> Hi, 
>    attached u will find a script called lotto1.py. When I run the script using __main__ 
> the interpreter does nothing and does not execute the function play. Please explain 

The way it's written, the 'if __name__ == "__main__":' line is part of the
function you defined, because it's still indented, so part of the def block.

Move that line and the lines after it back one level of indentation, and it
should work.

-- 
Remco Gerlich