[IPython-user] [pyreadline]Support for running as subprocess?

Liu Jin m.liu.jin at gmail.com
Wed Mar 15 21:07:07 CST 2006

[Sorry if this is a repost, I'm not sure my mailer delivered it or not]

On Windows, IPython running as an inferior process in Emacs produces
no output. That's because Windows has no psuedo-tty, so the
WriteConsole etc. calls are failing. I made a quick&dirty change to
console.py along these lines:

import os
ntemacs_hack = int(os.environ.get('READLINE_NTEMACS_HACK','0'))

class Console(object):
    if ntemacs_hack:
        def write_color(self, text, attr=None):
            junk = c_int(0)
            self.WriteFile(self.hout, text, len(text), byref(junk), None)
            return len(text)

        write_plain = write_color
        original write_color & write_plain definitions

The main functionalities seem ok. But there are plenty more console
api calls uncovered, yet I'm uncertain how to fix them. I guess this
problem will eventually disappear as IPython be decoupled from
readline, but any chance for a quick fix before that?

More information about the IPython-user mailing list