473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Running External Commands + Seeing when they are Finished

I'm currently working on a script that I will run when I leave my
computer on at night. It runs external commands like Ad-Aware, Spybot,
AVG, Avast, and the like. The problem is, I want to know how to make it
so that one command starts only after the last one finishes. When I run
them, they end up running all at once! Can someone please tell me if
this is possible? Judging from what I've seen in Python's versitility,
I bet it can...

May 27 '06 #1
4 1208
from os import *

for cmd in ['adaware', 'spybot']:
system(cmd)

May 27 '06 #2
The problem is with that (which is what I'm doing already) is that one
app is in a window and one app is on the command line. Thus, you end up
with both apps running at the same time. Are there any modules that
have functions for checking when windows are opened or closed?

May 27 '06 #3
Hello Tommy,

Use the subprocess module
(http://docs.python.org/lib/module-subprocess.html).

for app in MY_APPLICATION_LIST:
pipe = Popen(app)
pipe.wait()

HTH,
http://pythonwise.blogspot.com/

May 28 '06 #4
It works! Gasp!

Thanks!

May 30 '06 #5

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

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
3
by: Hal Vaughan | last post by:
I need to be able to run external commands from within a Java program, on Linux and Windows (and eventually OSX). Under most circumstances there is no problem, but if the path I specify as part of...
4
by: Fernando Rodriguez | last post by:
Hi, How can I save the output of an external program, called with os.system()?
7
by: Chris P. | last post by:
Hi. I've made a program that logs onto a telnet server, enters a command, and then creates a list of useful information out of the information that is dumped to the screen as a result of the...
10
by: shumaker | last post by:
I don't need a detailed description of a solution(although I wouldn't mind), but I am hoping someone could tell me in general the best path to go about accomplishing a task, since I don't know all...
2
by: VM | last post by:
Is it possible to run dos commands in the background without the user ever seeing that the command is running? When I run the application, I can always see the dos box (even if it's for a split...
2
by: Franck Diastein | last post by:
Hi, I'm designing an application, and I would like to be able to receive external commands... I would like a behavior like eMule, when you click on an ed2k link, the link is added to eMule, even...
11
by: RoB | last post by:
Hi all, I'm coming from the Informix world and I have a customer using DB2 8.2.3 for Linux on Red Hat Enterprise ES. The customer is performing filesystem backups of the containers etc every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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
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,...

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.