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

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


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?


More information about the Python-list mailing list