[Tutor] Getting the results of a file or command?

Jmllr891@cs.com Jmllr891@cs.com
Tue Nov 12 10:32:18 2002


--part1_106.1b3fb8bd.2b027858_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

How do you get the results from the execution of a file or system command? 
For example, if I asked Windows (err...technically speaking, DOS) to ping 
Python.org:

       os.system("ping python.org")

That would bring up a DOS box with all the results of the ping command, is it 
possible to somehow capture those results and store them in a string or a 
list?

Thanks,
Joshua Miller

--part1_106.1b3fb8bd.2b027858_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0">How do you get the results from the execution of a file or system command? For example, if I asked Windows (err...technically speaking, DOS) to ping Python.org:<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os.system("ping python.org")<BR>
<BR>
That would bring up a DOS box with all the results of the ping command, is it possible to somehow capture those results and store them in a string or a list?<BR>
<BR>
Thanks,<BR>
Joshua Miller</FONT></HTML>

--part1_106.1b3fb8bd.2b027858_boundary--