Executing a python script while it is running

bobicanprogram icanbob at gmail.com
Wed Jun 17 12:10:54 EDT 2009


On Jun 17, 1:42 am, Zach Hobesh <hob... at gmail.com> wrote:
> On Tue, Jun 16, 2009 at 6:37 PM, Chris Rebert<c... at rebertia.com> wrote:
> > On Tue, Jun 16, 2009 at 6:21 PM, <hob... at gmail.com> wrote:
> >> Hey Dave,
>
> >> Thanks for the helpful responses.
>
> >>> Option 2 is what you get by default.  Naturally it depends on what the
> >>> application  is using to launch the batch file, but the most common cases
> >>> will launch a separate process.
>
> >> The app ended up delaying starting the second batch file until it finished
> >> the first. I had the app trigger an infinite loop on completion, and sent
> >> two files through at the same time. The second file finished seconds after
> >> the first, but the batch file didn't trigger until I closed the first one.
>
> > Are you sure you aren't unknowingly having the app wait on the first
> > batch file process until it terminates? How exactly are you launching
> > the batch files?
>
> > Cheers,
> > Chris
> > --
> >http://blog.rebertia.com
>
> Hey Chris,
>
> I actually think that's what's happening, which is fine in my case
> (for now anyway) as I just need them all to complete, we don't need
> them running at the same time.  I'm using a job management system, and
> they have the option of triggering a command line after completing a
> job.
>
> A better/safer solution might be spawning another job and re-inserting
> to the jms queue.
>
> Thanks again,
>
> Zach


You might want to take a look at the Python-SIMPL toolkit (http://
www.icanprogram.com/06py/main.html).   SIMPL uses a Send/Receive/Reply
interprocess messaging scheme which will naturally queue requests for
you.   Without too much effort you may be able to reorient your scheme
to eliminate the batch file entirely.

bob



More information about the Python-list mailing list