Command Prompt (again)

E

EAS

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?
 
P

Peter Hansen

EAS said:
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
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top