help! - cmd line interpreter gone "dumb"

T

Tim

Maybe I've been working too long, but has anyon had their python interpreter
stop taking commands.

The IDLE version works fine, but under Windoze:

1) execute "python" in teh command shell
2) ...interpreter comes up fine
3) type in anything and you get "SyntaxError: invalid syntax"

Literally, you could type in "import sys" or anything common and you get the
same results.

Any help greatly appreciated--thanks.

Tim
 
T

Tim

Yes, reboot or have the programmer give his head a shake. ;-)

I love this language, but getting used to the little set up details I
guess...Half of it was my own ignorance, but it's not obvious.

For the record...

if I don't define any paths for Python, it naturally knows were to go for
the core + libraries.
but, if you define the PYTHONPATH in the environment--only those directories
are searched. It was probably the late night that had me forget when I
changed things (funny--its seemed to work for a long while, but the changes
may not have been reflected if I had the same command window open the entire
evening (this was the case, I think).

It makes sense...

Tim
 
P

Peter Hansen

Tim said:
For the record...

if I don't define any paths for Python, it naturally knows were to go for
the core + libraries.
but, if you define the PYTHONPATH in the environment--only those directories
are searched. It was probably the late night that had me forget when I
changed things (funny--its seemed to work for a long while, but the changes
may not have been reflected if I had the same command window open the entire
evening (this was the case, I think).

This wasn't likely the cause of all your problems. Try defining
that environment variable again, and check whether "import sys"
really does give a syntax error. If it does, it's something else,
because all PYTHONPATH should do is let you add more stuff to
the standard search path. (If you can get import sys to work,
type "sys.path" to see what is defined, and you'll see that the
stuff in PYTHONPATH merely goes at the front, just after the ''
item which means the directory from which the script runs.)

If you are really getting a syntax error, paste the full traceback
into another posting so we can see what it is. Maybe you were
typing with CAPSLOCK on? Or you had a module of your own in the
current directory, called sys.py, and it contained a syntax error,
so when you imported it you got confused? Definitely something
other than PYTHONPATH, I think.

-Peter
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top