[pypy-dev] RPython I/O

Maciej Fijalkowski fijall at gmail.com
Tue Mar 17 10:08:11 CET 2009

There are two official ways:

1. use directly os.read/os.open/os.write, rather tedious if you ask me
2. use interfaces that are present in pypy/rlib/streamio.py. I think
only documentation for that is in tests unfortunately :(

It has interface similar to python's streams, but adapted a bit to
accomodate rpythonism.


On Tue, Mar 17, 2009 at 10:03 AM, Ben Mellor <cumber at netspace.net.au> wrote:
> Hi
> Just wondering, what's the right way to do IO in an RPython program?
> sys.stdin/sys.stdout don't work, neither does opening files using open(), and
> raw_input doesn't work. All I can get is print. I can't find anything about
> this in the docs, and I haven't been able to understand how the PyPy
> interpreter is doing it from looking at the source code so far.
> I've been playing around with using the PyPy framework to implement a small
> interpreter, and this is currently blocking me from translating it.
> -- Ben Mellor
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev

More information about the Pypy-dev mailing list