LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-07-2014, 03:48 AM   #1
simhumcon
Member
 
Registered: Dec 2013
Posts: 35

Rep: Reputation: Disabled
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??
 
Old 05-07-2014, 04:25 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I think you need to use subprocess instead of commands (but I do not really understand what do you mean by monitor the progress).
 
1 members found this post helpful.
Old 05-07-2014, 04:33 AM   #3
simhumcon
Member
 
Registered: Dec 2013
Posts: 35

Original Poster
Rep: Reputation: Disabled
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!!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
View python script ButterflyMelissa Linux - Newbie 2 10-13-2012 03:29 PM
How to close open ports using a python script or a shell script in python ?? apanimesh061 Programming 3 11-20-2011 12:31 AM
How can you view the progress of a process started in a non-interactive shell? timingalls Linux - General 1 04-21-2009 02:29 PM
Shell Script Progress bar rooch84 Linux - Software 8 09-03-2005 04:55 PM
PROGRESS BAR with shell script murugesan Linux - Software 5 12-13-2004 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration