Forcing prompt to be on newline when embedding Python with stdin/out redirection

H Krishnan hetchkay at gmail.com
Thu Jan 5 02:09:11 EST 2017


Hi,

I am working on embedding Python in my application. I have redirected
sys.stdin and sys.stdout to call methods from a Qt TextEdit widget.
Everything works fine except that the Python prompt does not always come in
a new line:

>>> dir()
['__builtins__', '__doc__', '__name__', '__package__']>>>

Why doesn't the prompt appear in a new line as with the default stdout?

Thanks,
Krishnan



More information about the Python-list mailing list