Re: How to schedule system calls with Python

2009-10-23 Thread Jorgen Grahn
On Thu, 2009-10-22, Al Fansome wrote: Jorgen Grahn wrote: On Fri, 2009-10-16, Jeremy wrote: On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line

Re: How to schedule system calls with Python

2009-10-21 Thread Jorgen Grahn
On Thu, 2009-10-15, TerryP wrote: ... launching external programs, irregardless of language, generally falls into 3 major categories: 0.) blocks until program is done; like system 1.) replaces your program with process, never returns; like exec 2.) quickly return after asynchronously

Re: How to schedule system calls with Python

2009-10-21 Thread Jorgen Grahn
On Fri, 2009-10-16, Jeremy wrote: On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I

Re: How to schedule system calls with Python

2009-10-21 Thread Al Fansome
Jorgen Grahn wrote: On Fri, 2009-10-16, Jeremy wrote: On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system). I will have many

Re: How to schedule system calls with Python

2009-10-17 Thread catalinf...@gmail.com
And if you have this commands :alias ,ll ? This commands not working , see sh: ll: command not found and for watch and top need to use something to out from loops . On Oct 15, 11:15 pm, TerryP bigboss1...@gmail.com wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a

Re: How to schedule system calls with Python

2009-10-16 Thread Christian Heimes
MRAB wrote: You could use multithreading: put the commands into a queue; start the same number of worker threads as there are processors; each worker thread repeatedly gets a command from the queue and then runs it using os.system(); if a worker thread finds that the queue is empty when it

How to schedule system calls with Python

2009-10-15 Thread Jeremy
I need to write a Python script that will call some command line programs (using os.system). I will have many such calls, but I want to control when the calls are made. I won't know in advance how long each program will run and I don't want to have 10 programs running when I only have one or two

Re: How to schedule system calls with Python

2009-10-15 Thread TerryP
On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I want to control when the calls are made.  I won't know in advance how long each program will run and I don't

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 2:15 pm, TerryP bigboss1...@gmail.com wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I want to control when the calls are made.  I won't

Re: How to schedule system calls with Python

2009-10-15 Thread TerryP
On Oct 15, 8:52 pm, Jeremy jlcon...@gmail.com wrote: On Oct 15, 2:15 pm, TerryP bigboss1...@gmail.com wrote: If you want simple sequenceal execution of external programs, use a suitable blocking function to execute them (like system) combined with a simple loop over the sequence of commands

Re: How to schedule system calls with Python

2009-10-15 Thread MRAB
TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system). I will have many such calls, but I want to control when the calls are made. I won't know in advance how long each program will run

Re: How to schedule system calls with Python

2009-10-15 Thread Ishwor Gurung
Jeremy, Hi I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I want to control when the calls are made.  I won't know in advance how long each program will run and I don't want to have 10 programs running when I

Re: How to schedule system calls with Python

2009-10-15 Thread Ishwor Gurung
How can I use Python to schedule these commands? If I were as lucky as you, I would have used multiprocessing module[1] (my platform does not have sem_open() syscall). Others suggestions are s/have/implement/g -- Regards, Ishwor Gurung -- http://mail.python.org/mailman/listinfo/python-list

Re: How to schedule system calls with Python

2009-10-15 Thread Ishwor Gurung
How can I use Python to schedule these commands? If I were as lucky as you, I would have used multiprocessing module[1] (my platform does not have sem_open() syscall). Others suggestions are as good as it can be but yeah you could get a lot of work done using multiprocessing module(all the

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 6:32 pm, MRAB pyt...@mrabarnett.plus.com wrote: TerryP wrote: On Oct 15, 7:42 pm, Jeremy jlcon...@gmail.com wrote: I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I want to control when the calls are

Re: How to schedule system calls with Python

2009-10-15 Thread Jeremy
On Oct 15, 6:47 pm, Ishwor Gurung ishwor.gur...@gmail.com wrote: Jeremy, Hi I need to write a Python script that will call some command line programs (using os.system).  I will have many such calls, but I want to control when the calls are made.  I won't know in advance how long each

Re: How to schedule system calls with Python

2009-10-15 Thread Minesh Patel
Again another great suggestion.  I was not aware of the multiprocessing module, and I'm not (yet) sure if I understand why I should use instead of multithreading as explained by a previous post. http://docs.python.org/library/multiprocessing.html First paragraph... -- Thanks, --Minesh --