Command Prompt (again)

Discussion in 'Python' started by EAS, May 26, 2004.

  1. EAS

    EAS Guest

    2 days ago, I used the following script to get a command prompt on my
    system:

    import os
    os.system('cmd.exe')

    However, yesterday, when I tried to use it again, it did nothing but return
    "-1"
    to the screen. Anyone know what happened and how to fix it?
     
    EAS, May 26, 2004
    #1
    1. Advertising

  2. EAS

    Peter Hansen Guest

    EAS wrote:

    > 2 days ago, I used the following script to get a command prompt on my
    > system:
    >
    > import os
    > os.system('cmd.exe')
    >
    > However, yesterday, when I tried to use it again, it did nothing but return
    > "-1"
    > to the screen. Anyone know what happened and how to fix it?


    Screwed up the path?

    Try putting a "print os.getenv('PATH')" just before the call to
    os.system. Also try changing it, temporarily, to command.com
    instead, just to see what happens and if the screwup is limited
    to cmd.exe.

    Also, consider rewinding the source back to a previously working
    version. That will tell you if the problem is in your own code
    or in the environment (and here I just mean the surrounding system,
    not just the "environment variables"). Of course, to do this you
    would have to have been using a revision control system... but
    everyone does that, right? ;-)

    -Peter
     
    Peter Hansen, May 26, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rynox
    Replies:
    2
    Views:
    467
    Fred Kleinschmidt
    Jul 12, 2006
  2. chrisdude911
    Replies:
    10
    Views:
    135,435
    srk289
    Mar 10, 2009
  3. gaurav kashyap
    Replies:
    2
    Views:
    623
    gaurav kashyap
    Oct 30, 2008
  4. gaurav kashyap
    Replies:
    3
    Views:
    689
    gaurav kashyap
    Oct 31, 2008
  5. Mel
    Replies:
    10
    Views:
    3,131
    Sailaja Appi
    Feb 13, 2009
Loading...

Share This Page