Command Prompt (again)

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

    Command Prompt (again)

    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?


  • Peter Hansen

    #2
    Re: Command Prompt (again)

    EAS wrote:
    [color=blue]
    > 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?[/color]

    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 "environmen t variables"). Of course, to do this you
    would have to have been using a revision control system... but
    everyone does that, right? ;-)

    -Peter

    Comment

    Working...