Question

  • Thread starter Camilo Andres Roca Duarte
  • Start date
C

Camilo Andres Roca Duarte

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 isin a BegginersTutorial.

$ python myfunctions.py
SyntaxError: invalid syntax

This was taken from http://openbookproject.net/thinkcs/python/english2e/ch05.html in the 5.8 Numeral "Unit testing with doctest".

The only way I can run a script is opening it on a separate window and clicking in Run Module.

I would apreciate any help you could give me

Thanks

________________________________________
Camilo Andrés Roca Duarte
Estudiante de Ingeniería Eléctrica
C.C: 1.128.397.163

Salve un árbol. ¡No imprima este correo electrónico a no ser quesea realmente necesario!

Save a tree. Don't print this e-mail unless it's really necessary !
 
S

Steven D'Aprano

Camilo said:
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 myfunctions.py
SyntaxError: invalid syntax

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

[steve@sylar ~]$ python test.py
File "test.py", 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.
 

Members online

No members online now.

Forum statistics

Threads
474,091
Messages
2,570,605
Members
47,225
Latest member
DarrinWhit

Latest Threads

Top