On 11/11/11 22:17, Andreas Perstinger wrote:

I don't know about windows but if you want to run the script from the
command line you have to add:

if __name__ == "__main__":
main()

No, you only need to do that if you plan on using the file as a module at some point. If you don't need a module then the OPs style will work just fine on any OS.

But since having module facilities is so easy it is good practice to always use the if main clause...

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to