title: Interacting with bash from python
body: <p>I've been playing around with Python's <code>subprocess</code> module and I wanted to do an "interactive session" with bash from python. I want to be able to read bash output/write commands from Python just like I do on a terminal emulator. I guess a code example explains it better:</p>
  
  <pre><code>&gt;&gt;&gt; proc = subprocess.Popen(['/bin/bash'])
  &gt;&gt;&gt; proc.communicate()
  ('user@machine:~/','')
  &gt;&gt;&gt; proc.communicate('ls\n')
  ('file1 file2 file3','')
  </code></pre>
  
  <p>(obviously, it doesn't work that way.) Is something like this possible, and how?</p>
  
  <p>Thanks a lot</p>