[Pythonmac-SIG] Using a unix Python with a MacPython Lib tree

Just van Rossum just@letterror.com
Wed, 4 Apr 2001 22:28:46 +0200


Jonathan Wight wrote:

> The only extensions to the IO system necessary are for people
> doing weird things - like the CR/LF swapping or re-routing output for
> embedded Python.

I may be missing something, but rerouting output is a matter of assigning a
file-like object (any object with a write method actually) to sys.stdout and/or
sys.stderr. All C code is supposed to call PySys_WriteStdout() instead of
fwrite(stdout...), so this actually works.

Just