Re: NameError: name '__main__' is not defined

2009-09-14 Thread Andre Engels
On Mon, Sep 14, 2009 at 4:29 AM, Sean DiZazzo wrote: > Is this a production program that you are using?? > > Please show us the point you are trying to make in something more > valuable. I find this a very bad comment. Not only is it rude, it is condemning a behaviour I would see as beneficial.

Re: NameError: name '__main__' is not defined

2009-09-14 Thread Hendrik van Rooyen
On Monday 14 September 2009 03:43:19 Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : > prin

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
On Sep 13, 6:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!\

Re: NameError: name '__main__' is not defined

2009-09-13 Thread André
On Sep 13, 10:43 pm, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python > > if __main__ == '__main__' : >   print "Hello World!

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Xavier Ho
Try if __name__ == '__main__' :], Xav On Mon, Sep 14, 2009 at 11:43 AM, Peng Yu wrote: > Hi, > > I try the following code. I don't quite understand why __main__ is not > defined. Could somebody let me know what I am wrong about it? > > Regards, > Peng > > $ cat test.py > #!/usr/bin/env python