471,337 Members | 813 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Call shell script from python script, exit without waiting for shell script to finish

Can someone please help me with this:

I have a python script, that at some point calls a linux bash script (.sh). Starting the shell script is the last thing my python script needs to do, so I would like for the python script to exit once the call has been made, without waiting for the shell script to finish.

My question is:

how do I call a shell script from a python script?

and how do I do that such that control is tranferred to the shell script and the python script does not wait for the shell script to exit, but clean itself up?
Oct 4 '07 #1
3 5244
bartonc
6,596 Expert 4TB
Can someone please help me with this:

I have a python script, that at some point calls a linux bash script (.sh). Starting the shell script is the last thing my python script needs to do, so I would like for the python script to exit once the call has been made, without waiting for the shell script to finish.

My question is:

how do I call a shell script from a python script?

and how do I do that such that control is tranferred to the shell script and the python script does not wait for the shell script to exit, but clean itself up?
See spawn* and P_NOWAIT in 14.1.5 Process Management of the 2.5 documentation.
Oct 4 '07 #2
Thanks. That's what I was looking for.
Oct 8 '07 #3
bartonc
6,596 Expert 4TB
Thanks. That's what I was looking for.
You are welcome. I live to hear those words!

Keep posting,
Barton
Oct 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Christian | last post: by
1 post views Thread by Art Vandelay | last post: by
6 posts views Thread by Hugh Janus | last post: by
6 posts views Thread by bikkaran | last post: by
113 posts views Thread by John Nagle | last post: by
4 posts views Thread by devi thapa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.