title: How to run bash commands inside of a Python script
body: <p>I am trying to run both Python and bash commands in a bash script.
  In the bash script, I want to execute some bash commands enclosed by a Python loop:</p>
  
  <pre><code>#!/bin/bash
  
  python &lt;&lt; END
  for i in range(1000):
      #execute‬ some bash command such as echoing i
  END
  </code></pre>
  
  <p>How can I do this?</p>