I&#39;m needing to transfer the following shell construct to Python, plus save the output of execution:<br><br>FTP_SITE=&#39;<a href="http://ftp.somesite.com">ftp.somesite.com</a>&#39;<br>ftp -a  $FTP_SITE &lt;&lt;EOF<br>binary<br>
prompt off<br>cd /some_dir<br>dir<br>bye<br>EOF<br><br>Here, the FTP client accepts commands from STDIN, so all commands are saved in a temporary file which is redirected to the client application.<br><br>I also need to save whatever output is generated.  How can this be done in Python?<br>
<br>Thanks.<br><br>Jim<br>