title: run Python script in Bash loop
body: <p>I have a python script, which can only be executed a finite number of times before it throws an error (on the terminal). I need to execute it those many times.</p>
  
  <p>Is it possible to do this using a loop in a Bash script? I know a Bash script can read the output of a command from the terminal, but I have no idea how to go about this.</p>
  
  <p>I tried searching for this problem on this site, but I found nothing. Sorry if this has been asked before.</p>
  
  <p>EDIT</p>
  
  <p>I can modify the Python script to return a value depending whether the execution is successful or not. What I want to know is, how to read this returned value in a loop in a Bash script. If the execution was successful, it must execute the Python script again. If not, it must exit.</p>
  
  <p>If there is any other way, that is welcome, too.</p>