title: Telnet automation / scripting
body: <p>I have already checked <a href="https://stackoverflow.com/questions/709801/creating-a-script-for-a-telnet-session">this question</a> but could not find what I'm looking for.  I am running Windows (the client), and the server is a legacy mainframe type server.</p>
  
  <p>Basically I need to write a script, python code or whatever, to send some know commands to the server via telnet, and preferable capture the output.  Then return when done.</p>
  
  <p>What's the best approach?</p>