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

Home Posts Topics Members FAQ

Re: [Tutor] Replacing cmd.exe with custom .py application

Joseph:
Check out subprocess. The subprocess module is on python
2.4. Also, use subprocess.call("your command",shell=True)

On Linux/Unix, the process is below

import subprocess

ret = subprocess.call("dir",shell=True,stdout=open('/dev/null','w'),stderr=subprocess.STDOUT)

print ret

You should get a return value of 0. Which means that it was
successful. I'm still learning this myself, so some of these other
guys might have more input.

On Tue, Sep 30, 2008 at 10:32 AM, A. Joseph <jo******@gmail.comwrote:
>

Instead of going to the command line all the time, I want to create a small
customized cmd.exe of my own, how can I get the return value from
os.system() because I was thinking I can do soothing with os.system(), In
case my question is not clear, just like an IDE that plugged in another
.exe application.

Sorry for any mistake in my question. Just help me if you can

_______________________________________________
Tutor maillist - Tu***@python.org
http://mail.python.org/mailman/listinfo/tutor



--
Ezra Taylor
Sep 30 '08 #1
0 1668

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

Similar topics

5
1917
by: News | last post by:
Hello. I've just started learning Python a few weeks ago. I'm using the free "How to Think Like a Computer Scientist: Learning with Python". I'm half-way through chapter 5 and I've been stumbling...
3
1222
by: administrata | last post by:
i'm using tutor maling... i e-mail some questions to tutor and get answers. but, i frequently get mails which aren't related with my question. how should i stop it?
7
1716
by: Rob Meade | last post by:
Hi all, Been a long time since I've been here... /me waves to all.. Ok - my conundrum.. I have a form where a user can enter text and BB codes...for example:
4
1622
by: Tim M. | last post by:
one of my assignments is create a class named numbers whose Main()method holds two interger variables, assign values to the variables. within the class, create two methods, Sum() and...
0
970
by: Henry Stock | last post by:
I have been studying c-sharp for a while, but I have a project that will involve much learning along the way. I am looking for a person that would be willing to consult with me that has experience...
6
1991
by: Greg M | last post by:
I have 5 years of MS Access/VBA development experience and am moving into the VB.net world. I am seeking a tutor which could facilitate this move. I live in Anderson, IN and am willing to...
0
1535
by: Marian Heddesheimer | last post by:
Rent-a-Tutor.com is in search for testers as online-courses students. As operators of rent-a-tutor.com we are proud to offer high quality online courses over the internet at reasonable prices. At...
10
1905
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL...
0
185
by: Ezra Taylor | last post by:
Is there something similar to /dev/null on Windows? On Tue, Sep 30, 2008 at 2:13 PM, Ezra Taylor <ezra.taylor@gmail.comwrote: -- Ezra Taylor
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7042
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
7495
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
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
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.