using sockets the same as in Ruby ?

Markus Jais mjais at web.de
Mon Feb 17 08:22:30 EST 2003


hello

how can I do something like this Ruby code in Python

=================
t = TCPSocket.new($host, $port)
t.print("something")
while line = t.gets
    puts line
end
==================

that is, how can I read from a socket line by line ?
in the doc I found only the recv function which needs a buffer size.


thanks in advance for any hints

markus






More information about the Python-list mailing list