By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

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

P: 2
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
Share this Question
Share on Google+
3 Replies


bartonc
Expert 5K+
P: 6,596
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

P: 2
Thanks. That's what I was looking for.
Oct 8 '07 #3

bartonc
Expert 5K+
P: 6,596
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.