LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   execute shell script from python and view progress (https://www.linuxquestions.org/questions/linux-newbie-8/execute-shell-script-from-python-and-view-progress-4175504173/)

simhumcon 05-07-2014 03:48 AM

execute shell script from python and view progress
 
hello all!

i have a python script that will call for a shell script as below :

commands.getoutput("./run_all.sh")

but im not able to view the progress from run_all.sh script. i want to execute that shell script from a python script and monitor the progress. how do i accomplish this??

pan64 05-07-2014 04:25 AM

I think you need to use subprocess instead of commands (but I do not really understand what do you mean by monitor the progress).

simhumcon 05-07-2014 04:33 AM

hi there!

i tried using subprocess.call and it works as how i wanted. thank you again!
what i meant by monitor the progress is that when my python script calls for the shell script, the shell script takes about 2 hours to complete. there will alot of output from the shell script. i wanted to view all those output. unfortunately, commands.getoutput doesnt do that subprocess.call works fine! thank you again!!!!


All times are GMT -5. The time now is 02:04 AM.