Stream Abstractions in python?

Gerhard Häring gerhard.haering at
Tue Mar 11 14:11:02 CET 2003

Daniel Nielsen <djn at> wrote:
> Hi. 
> I'm toying around with python... The only reason I see right now to
> continue using java for distributed stuff, is java's
> Data{In,Out}putStream with sockets. Is there an equivalent abstraction
> to TCP streams in Python? I have been looking around,
> but couldnt anything...
> Using google I've found ,
> which seems to do what I want, but I'd like to see what other
> alternatives there are out there. 

You might want to take a look at Twisted [1]. It nicely decouples protocol
implementations from the underlying transport, among others. If you're
doing network programming and/or implementing custom protocols it's IMO a
very good framework.

> Note: I do not require it to be compatible with java's streams, I'd just
> like the convenience of readUTF/writeUTF and friends.

Hmm. What about using codecs.EncodedFile for this? [2]

-- Gerhard

[1] -- Argh. Can't connect currently.

More information about the Python-list mailing list