Executing a python script while it is running

hobesh at gmail.com hobesh at gmail.com
Tue Jun 16 21:21:56 EDT 2009

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.

> For option 4, you could just have the batch file launch a script that  
> moves the file locally into a standard place, then the all-day-long  
> (background) script will actually do the slow move on any file it spots  
> in the special directory. If you need more information, you could add  
> also create a text file that identifies the other parameters to go with  
> the file. In any case, the background script would poll the directory for  
> work to do, do it, then check again. Any time the poll fails, just sleep  
> for 30 seconds or so.

I just tried a simple test with this basic outline, and it seemed to work  
fine. I had the app write a batch file and throw that batch file into the  
special directory. The background script grabbed the batch files and ran  
them in order of time created.

Still not sure what the best option is. I'm not sure what will happen if I  
just let the app regulate itself, so I may go with option 4.

Thanks again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090617/59365d5c/attachment-0001.html>

More information about the Python-list mailing list