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
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
./test.py, line 3, in module
if __main__ == '__main__' :
NameError: name '__main__' is not defined
--
http://mail.python.org/mailman/listinfo/python-list
/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
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
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