473,508 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Command Prompt (again)

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?
Jul 18 '05 #1
1 1403
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

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2607
by: EAS | last post by:
Is there any way of using Python to open a command prompt?
0
834
by: Laura Zeafla via .NET 247 | last post by:
I used the .NET forms application wizard. From the form youclick a button and it calls a C++ function through its dll. This function is supposed to pop-up a command prompt window. Something about...
6
14584
by: Paul Deverson | last post by:
I'm a newbie to MySQL and am really confused about when I should be using the Command Line Client and when the DOS prompt. I'm using Windows XP and I've just installed MySQL 4.1.10. I can use...
4
2512
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
3
6262
by: David Eadie | last post by:
G'Day all, I cant for the God in me work out how to execute the following command line in vb.net: (watch for the word wrapping also) Sub(ByVal username As String) Shell("ECHO Y| cacls...
17
7881
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
9
2245
by: RajW | last post by:
Disclaimer: I'm new to C. I'm building a simple text based program and I'm not sure I'm designing it correctly. What I have is simple and it works but it just seems weird. Is there a better way?...
4
10488
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
4
2520
by: bkamrani | last post by:
Hi, This is a basic problem, but I want to print help content in a Command Prompt in WinXP and scrolling back to see the first lines. If I start a command prompt and run python, and then for...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.