title: os.system for submitting command
body: <p>I am using os.system to submit a command to the system.</p>
  
  <p>I.e.,</p>
  
  <pre><code>import os
  os.system(my_cmd)
  </code></pre>
  
  <p>But I was wondering how could I obtain the output, i.e., let us say i am in the bash and I type in my cmd, I'd get an output of this form:</p>
  
  <pre><code>Job &lt;57960787&gt; is submitted to queue &lt;queueq&gt;.
  </code></pre>
  
  <p>How can I, in python, using the os.system(cmd), also obtain the text output, and parse it to obtain the job id, 57960787.</p>
  
  <p>Thanks!</p>