468,116 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,116 developers. It's quick & easy.

help! - cmd line interpreter gone "dumb"

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

Jul 18 '05 #1
2 1681
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

"Gerhard Häring" <gh@ghaering.de> wrote in message
news:ma**********************************@python.o rg...
Tim wrote:
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.


I've seen that when I used os.spawn* (or was it os.execv*?), apparently
in a wrong way.
Any help greatly appreciated--thanks.


Typical Windows answer: reboot and try again ;-)

-- Gerhard

Jul 18 '05 #2
Tim wrote:

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
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ryan | last post: by
9 posts views Thread by jsummit | last post: by
numberwhun
1 post views Thread by numberwhun | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.