help! - cmd line interpreter gone "dumb"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim

    help! - cmd line interpreter gone "dumb"

    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 "SyntaxErro r: invalid syntax"

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

    Any help greatly appreciated--thanks.

    Tim



  • Tim

    #2
    Re: help! - cmd line interpreter gone "dumb&quot ;

    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" <[email protected] > wrote in message
    news:mailman.10 57524309.16869. [email protected] ...[color=blue]
    > Tim wrote:[color=green]
    > > Maybe I've been working too long, but has anyon had their python[/color][/color]
    interpreter[color=blue][color=green]
    > > 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 "SyntaxErro r: invalid syntax"
    > >
    > > Literally, you could type in "import sys" or anything common and you get[/color][/color]
    the[color=blue][color=green]
    > > same results.[/color]
    >
    > I've seen that when I used os.spawn* (or was it os.execv*?), apparently
    > in a wrong way.
    >[color=green]
    > > Any help greatly appreciated--thanks.[/color]
    >
    > Typical Windows answer: reboot and try again ;-)
    >
    > -- Gerhard
    >[/color]


    Comment

    • Peter Hansen

      #3
      Re: help! - cmd line interpreter gone &quot;dumb&quot ;

      Tim wrote:[color=blue]
      >
      > 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).[/color]

      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

      Comment

      Working...