[IPython-user] PyReadline: No tab completion if sys.stdout is redirected
Thu Dec 20 05:29:39 CST 2007
> I'm not sure why things work like this but I have attached a script with
> a possible workaround.
Thanks. Do you have any idea how to make this work with code.interact()
instead of raw_input()?
I have tried the following workaround: Leave sys.stdout untouched but
redirect all "print" statements explicitly to the custom file-like
console object. I had to change all print statements, but it works.
To automatically evaluate expressions entered interactively and use my
custom console object, I used sys.displayhook.
But there's one issue still: If the string is too long, there's no
output. See the attachment for an example. I think the problem is in the
self.console.write() call, because everything is ok if I call
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the IPython-user