title: Write a python script that enters commands on an ubuntu terminal?
body: <p>I am using spyder on ubuntu 16.04.  I want to write a script that will execute several commands in the same linux terminal.</p>
  
  <p>First I want to open a terminal, then ssh into another computer, then enter my password, then continuing entering commands.</p>
  
  <p>I have tried <code>os.system(command)</code> but this does not open a new terminal for me nor run the command I want.</p>
  
  <p><code>os.system("gnome-terminal -e 'bash -c \"ssh blah blah blah; exec bash\"'")</code>
   works but I am stuck when trying to enter my password.</p>
  
  <p>How can I enter commands with a Python script in this context?</p>