Re: NameError: name '__main__' is not defined

2009-09-14 Thread Hendrik van Rooyen
World!\n $ ./test.py Traceback (most recent call last): File ./test.py, line 3, in module if __main__ == '__main__' : NameError: name '__main__' is not defined You are looking for __name__ , not __main__ if __name__ == '__main__': We are at the top of the tree so run something print

Re: NameError: name '__main__' is not defined

2009-09-14 Thread Andre Engels
On Mon, Sep 14, 2009 at 4:29 AM, Sean DiZazzo half.ital...@gmail.com 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

NameError: name '__main__' is not defined

2009-09-13 Thread Peng Yu
./test.py, line 3, in module if __main__ == '__main__' : NameError: name '__main__' is not defined -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Xavier Ho
/env python if __main__ == '__main__' : print Hello World!\n $ ./test.py Traceback (most recent call last): File ./test.py, line 3, in module if __main__ == '__main__' : NameError: name '__main__' is not defined -- http://mail.python.org/mailman/listinfo/python-list -- http

Re: NameError: name '__main__' is not defined

2009-09-13 Thread André
World!\n $ ./test.py Traceback (most recent call last):   File ./test.py, line 3, in module     if __main__ == '__main__' : NameError: name '__main__' is not defined You wrote __main__ instead of __name__. It should have been: if __name__ == '__main__': ... André -- http://mail.python.org

Re: NameError: name '__main__' is not defined

2009-09-13 Thread Sean DiZazzo
World!\n $ ./test.py Traceback (most recent call last):   File ./test.py, line 3, in module     if __main__ == '__main__' : NameError: name '__main__' is not defined Is this a production program that you are using?? Please show us the point you are trying to make in something more valuable