displaying properly formatted output of ipconfig.exe

Cameron Laird claird at lairds.com
Sat Nov 8 19:48:23 EST 2003


In article <vqqu1p7s48ep05 at corp.supernews.com>,
Francis Avila <francisgavila at yahoo.com> wrote:
>
>"Joe Flynt" <joe.flynt at mail.portland.co.uk> wrote in message
>news:601be7f8.0311081449.24b3f7e2 at posting.google.com...
			.
			.
			.
>> cmdpipe = os.popen("ipconfig","r")
>> lines = cmdpipe.readlines()
>> print lines
>
>You don't want to print a list of strings, you want to print each string in
>a list....
>
>  lines = cmdpipe.readlines()
>- print lines
>+ for line in lines:
>+     print line
			.
			.
			.
OR perhaps you want simply to print the output:
- lines = cmdpipe.readlines()
- for line in lines:
-     print line
+ print cmdpipe.read()

(There are other alternatives; these are likely to be of most interest.)
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net




More information about the Python-list mailing list