Newbie Question:Please help

Rob Weir rweir at ertius.org
Tue Sep 9 08:17:14 CEST 2008


On  9 Sep 2008, Karthik Krishnan wrote:
> File "<stdin>", line 1
> python main_test.py
>
> Syntax Error: invalid syntax

I get:

  File "/tmp/x.py", line 11
    if __name__ = "__main__":
                ^
SyntaxError: invalid syntax

> if __name__ = "__main__":
              ^
= is used for assignment in Python, you want ==.

-- 
-rob




More information about the Python-list mailing list