473,399 Members | 3,832 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,399 software developers and data experts.

How to start more than one process at the same time?

Hi!

How can I start several jobs at the same time with python? I want to
collect data from some servers and I don't want to wait until the first
server is finished. These jobs should run parallel to save time.
What I tried is this:
os.popen('regdmp -m \\\\server1
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
>av_server1.txt')
os.popen('regdmp -m \\\\server2
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
>av_server2.txt')
os.popen('regdmp -m \\\\server3
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
>av_server3.txt')
I didn't get an error-message, but I also didn't get a result. No
text-file was created.
I also tried to do the same thing via batch-files, but that didn't
change anything.

Is it just not possible or what am I doing wrong?

Thanks for any help!
Dirk Hagemann

Jul 14 '06 #1
3 1684
Have you considered a multi-threaded solution?

The following websites offer reasonable examples:

http://en.wikibooks.org/wiki/Program...thon/Threading
http://www.wellho.net/solutions/pyth...t-example.html

-Derek

Dirk Hagemann wrote:
Hi!

How can I start several jobs at the same time with python? I want to
collect data from some servers and I don't want to wait until the first
server is finished. These jobs should run parallel to save time.
What I tried is this:
os.popen('regdmp -m \\\\server1
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
av_server1.txt')
os.popen('regdmp -m \\\\server2
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
av_server2.txt')
os.popen('regdmp -m \\\\server3
"HKEY_LOCAL_MACHINE\\Software\\Intel\\LanDesk\\Vir usProtect6\\CurrentVersion\\Clients"
av_server3.txt')

I didn't get an error-message, but I also didn't get a result. No
text-file was created.
I also tried to do the same thing via batch-files, but that didn't
change anything.

Is it just not possible or what am I doing wrong?

Thanks for any help!
Dirk Hagemann
Jul 14 '06 #2

Look into the subprocess module. Possibly relevant link follows:

http://docs.python.org/lib/node244.html

Jul 14 '06 #3
>>>>"Dirk Hagemann" <Di**********@gmail.com(DH) wrote:
>DHHi!
DHHow can I start several jobs at the same time with python? I want to
DHcollect data from some servers and I don't want to wait until the first
DHserver is finished. These jobs should run parallel to save time.
Use the subprocess module.
--
Piet van Oostrum <pi**@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: pi**@vanoostrum.org
Jul 14 '06 #4

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

Similar topics

5
by: toby | last post by:
Can any one help? I'm trying to use System.Diagnostics.Process.Start to open legacy MS access aplications (ade and mdb files) and vb 6 .exe's using asp.net. There is something confusing going on?!?...
6
by: vee_kay | last post by:
Ihave a written aprogram in C which implements _beginthread(to create a thread) and _endthread(to end a thread).The program need to write a string of date n time to a file for each succesful thread...
6
by: Dmitri Shvetsov | last post by:
Hi, Can I start an external process from the Web Service? I'm using a code, compiler keeps silence, compiles ok and starts the project. When I trace in Debugger it doesn't start an external...
29
by: Ken Allen | last post by:
I have a number of services developed in C# (.Net), and they have been working fine for the most part. Recently someone reported that ipon occassion (originally rarely, but more frequently on some...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
3
by: tshad | last post by:
I created a service in VS 2003 and the code works fine as an application, but not as a service. It installs fine, but when I try to start it, it tells me it was unable to start. Am I missing...
4
by: Jianwei Sun | last post by:
Hi, all, I have a question, and I hope to get some hints here.. I created a really simple service just to check why the service manager doesn't start my service the second time if the first...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
6
by: buffinator | last post by:
I have two applications that should work together, let's call them A and B. The first time A starts, it should open a B process and start communicating with it. All other times an A instance...
9
by: SAL | last post by:
I have an ASP.NET 2.0 app that takes about 17 seconds to load on first startup but then is very fast after that. As I understand it from some posts in June, this is caused by the loading of the App...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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
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
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
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...

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.