By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a

Look into the subprocess module. Possibly relevant link follows:

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

Jul 14 '06 #3

P: n/a
>>>>"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 discussion thread is closed

Replies have been disabled for this discussion.