syntax error

S

Sheldon

Hi Everyone,

I am new here but I am pretty good at python programming but I am not
exert. I have been away from programming for about a year and now I am
programming in python again in combination with IDL.
I came across a error that puzzles me and I need some help. It is
pretty simple error but I suspect that the problem is not what is
python says it is.
While parsing a module my python reported a synthax error that, to me,
seemed perfectly ok:

Traceback (most recent call last):
File "/local_disk/opt/MSG_PostProc/scr/sheldon_cmsaf_remap.py", line
2, in ?
from msgpp_config import *
File "/local_disk/opt/MSG_PostProc/cfg/msgpp_config.py", line 73
from smhi_safnwc_legends import *
^
SyntaxError: invalid syntax

Now I know that there is no synthax error with that line of code. I
have also checked for indentations errors. I think that the error is
something else. Can anyone point me in the right direction? What
triggers such erroneous errors in Python?

Sincerely,
Sheldon
 
R

Rod Furey

Sheldon said:
SyntaxError: invalid syntax

Now I know that there is no synthax error with that line of code. I
have also checked for indentations errors. I think that the error is
something else. Can anyone point me in the right direction? What
triggers such erroneous errors in Python?

Being a newbie I'm still finding my way around this lot but I've
found that when this happens it's usually something on the preceeding
line that's wrong.
 
F

Fredrik Lundh

Sheldon said:
I am new here but I am pretty good at python programming but I am not
exert. I have been away from programming for about a year and now I am
programming in python again in combination with IDL.
I came across a error that puzzles me and I need some help. It is
pretty simple error but I suspect that the problem is not what is
python says it is.
While parsing a module my python reported a synthax error that, to me,
seemed perfectly ok:

Traceback (most recent call last):
File "/local_disk/opt/MSG_PostProc/scr/sheldon_cmsaf_remap.py", line 2, in ?
from msgpp_config import *
File "/local_disk/opt/MSG_PostProc/cfg/msgpp_config.py", line 73
from smhi_safnwc_legends import *
^
SyntaxError: invalid syntax

Now I know that there is no synthax error with that line of code. I
have also checked for indentations errors. I think that the error is
something else. Can anyone point me in the right direction? What
triggers such erroneous errors in Python?

Python 2.4.1 contained a bug that could result in spurious syntax errors for
relatively large files that uses PEP 263-style coding directives [1].

what Python version are you using ?

</F>

1) http://www.python.org/peps/pep-0263.html
 
S

Sheldon

Hi Rod,

This sounds very interesting. I am checking the previous lines and will
get back to you.

Thanks,
Sheldon
 
S

Sheldon

Hi Rod,

You were right. The error was on the previous line. I will remember
that.
Thanks for your help!

Sheldon
 
S

Sheldon

Hi Fredrik,

I am using python 2.3.3
I am checking now the previous lines for errors.

Thanks,
Sheldon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,037
Latest member
MozzGuardBugs

Latest Threads

Top