Newbie Question:Please help

Karthik Krishnan krishnan.1000 at gmail.com
Tue Sep 9 02:10:42 EDT 2008


Hi,

I am a newbie to python and I hope this is not a stupid question. I am
trying to run a main method from a Python command line using the command
shell using the command.

python main_test.py

I get the following error.


File "<stdin>", line 1
  python main_test.py

Syntax Error: invalid syntax

My main file main_test.py is given below.

#!/usr/bin/env python

""" Test method to run the main method.

"""

def main():
  print "Main method called.";


if __name__ = "__main__":
  main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080908/149c7600/attachment.html>


More information about the Python-list mailing list