main in mac?
Park997
park997 at aol.comnotospam
Tue Mar 13 12:32:30 EST 2001
More information about the Python-list mailing list
Tue Mar 13 12:32:30 EST 2001
- Previous message (by thread): main in mac?
- Next message (by thread): main in mac?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>I don't know what the run all button is (not on mac), but the whole reason >for this idiom is so it wont 'do anything' when imported. If a file named >x.py is imported, then it's __name__ is x. If it is being run as a program, >then it's __name__ is __main__. > > >David I knew that was the expected behavior, and the disadvantage of replacing if __name__ is __main__. with if 1: is that it does run when imported. Turning the run as main option on or off produces the expected behavior on the mac. Incidently, I am very impressed with the mac Python port. It must have been pretty tricky moving everything to a no command prompt system. Wendell
- Previous message (by thread): main in mac?
- Next message (by thread): main in mac?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list