473,796 Members | 2,690 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=Tr ue,stdout=open( '/dev/null','w'),stde rr=subprocess.S TDOUT)

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.or g
http://mail.python.org/mailman/listinfo/tutor



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

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

Similar topics

5
1933
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 on a few things. I've been teaching myself so far. I was wondering if anyone out there would be able to help me along with this. Maybe help explain some things and give me ideas for practice programs that go along with what I'm learning. And if you...
3
1232
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
1733
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
1632
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 Difference(),that compute the sum of the difference between the values of the two variables, respectively. each method should perform the computation and display the results. in turn call each of the two methods from Main(), passing the values of the two...
0
984
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 in C#, VB.NET, web services and working with Office Applications in particular. I want to build an application in which I can pull data from and SQL Server Database and use it to populate either an Excel workbook or a Word document. I can...
6
2024
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 travel to Indianapolis or within 50 miles of my home. I have some specific questions that I would like answered/explained to me. I would also like to develop a mentoring relationship which would allow me to ask questions in the future as well (for a...
0
1553
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 the moment, our courses are all available in German. These courses have proven themselves to be very user-friendly and understandable on the German market. So starting January 2006, we will provide them in English as well. All of my courses...
10
1940
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 Server 2000 on a machine and didn't install SQL Server 2005 Express with my VS .NET installation, how do I set up my existing SQL 2000 server to be the membership & roles provider for ASP .NET?
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
9679
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2924
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.