Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

run a subprocess in a loop

$
0
0

I have for loop in python in each iteration of the loop I want to run a bash script and after its termination continue the loop and again run the bash script:

for batch in something:    proc = Popen(['./mybash.sh'])    proc.wait()

The mybash.sh script will compute something and display a value using echo. However, when I run this code it seems that it executes mybash.sh script only once, since I can only see the value displayed by echo only for the first iteration. What is wrong with the code? BTW, I am using python 3.5


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>