Steven D'Aprano steve+comp.lang.python at
Mon Aug 1 04:55:32 EDT 2011

Camilo Andres Roca Duarte wrote:

> Hello
> My name is Camilo Roca, I'm a student and recently installed the 2.7.2
> Python version. The problem is that anytime I try to run a script from the
> Python Shell it returns an error message. I am new using python so I am
> not sure what to do since what I'm typing in the shell is in a
> BegginersTutorial.
> $ python
> SyntaxError: invalid syntax

I would be very surprised if that is the real error message you get. I would
expect something like this:

[steve at sylar ~]$ python
  File "", line 1
    def func:
SyntaxError: invalid syntax

Note that the error shows the line that is bad, and puts an up-arrow ^
directly under where it goes bad.

Please COPY and PASTE the FULL error. Do not re-type it from memory,
summarise it, put it in your own words, or otherwise change it in any way.


More information about the Python-list mailing list