[Tutor] Instances

alan.gauld@bt.com alan.gauld@bt.com
Fri, 19 Jul 2002 17:51:21 +0100


> not defined. In other words, I have to write n = test() 
> myself in the IDLE window. 
	
Does it work outside IDLE?

ie can you just douyble click the .py file?

If not I suspect you are missing the 

if __name__ == "__main__":
   n = test()

stanza to create a runnable script.

In fact you can miss the if test out and just put a last line of 

test()

But then you couldn't easily import the module elsewhere...

Alan g.