Background subprocess help?

danshumaker dan.shumaker at comcast.net
Fri May 22 21:53:34 EDT 2009


Hi,
I'm trying to do something as simple as this:

"sleep 10; mail -s "test" dans < communicate_with_process &"

which executes immediately because it is backgrounded with "&".

or more generically in english:

"do some long process in the background;  send me mail when it's done; allow
me to quit the tool that started launched the long process."

I've found several examples that are close but none of the permeatations I
try work.  The closest examples I've found start sending signals to
processes and/or callbacks and 50+ lines of python code.

I found the cliUtils module which came close.. but no cigar.

I find it hard to believe that a one liner in bash/tcsh has to end up being
many lines in python.  That makes me think I'm missing something.

Surely thousands of people have done this before -- start a background
process and want notification when it's done.

Anybody have any suggestions on modules to  try or quick subprocess commands
that work?  This came close
http://docs.python.org/library/subprocess.html#replacing-shell-pipeline but
no cigar too.

Thank you so much for any help or suggestions.

   -d
-- 
View this message in context: http://www.nabble.com/Background-subprocess-help--tp23680206p23680206.html
Sent from the Python - python-list mailing list archive at Nabble.com.




More information about the Python-list mailing list