title: How to run commands on shell through python
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/89228/calling-an-external-command-in-python">Calling an external command in Python</a>  </p>
  </blockquote>
  
  
  
  <p>I want to run commands in another directory using python.</p>
  
  <p>What are the various ways used for this and which is the most efficient one?</p>
  
  <p>What I want to do is as follows,</p>
  
  <pre><code>cd dir1
  execute some commands
  return 
  cd dir2
  execute some commands
  </code></pre>