stream to string-question
Klaus Reinhardt
K.Rdt at TU-Berlin.DE
Mon Jul 1 04:00:08 EDT 2002
---------------------------------------------------------------------
Hi
y=os.popen( 'netstat -a -n','r').read()
# Aktive Verbindungen
#
# Proto Lokale Adresse Remote-Adresse Status
# TCP 0.0.0.0:1171 0.0.0.0:0 LISTENING
# TCP 130.149.164.212:1171 130.149.4.11:110 ESTABLISHED
print y
for i in y:
print "--------: ", i
The last is outputting each character in a single line. Is
there a function to convert this stream in the text-rows?
K at Rdt
---------------------------------------------------------------------
More information about the Python-list
mailing list