Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread H Krishnan
Thanks for your help. > > > > > I am working on embedding Python in my application. > > You forgot to tell us the version of Python that you're embedding. > > I am using Python2.7. > > I have redirected sys.stdin and sys.stdout to call methods from a Qt > TextEdit > > widget. Everything works

Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread eryk sun
On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan wrote: > I tried replacing sys.displayhook with a function that does not print > newline but the newline still got inserted. So, I am not sure where the > newline is coming from. In any case, I could override sys.displayhook to add >

Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread H Krishnan
Hello Mr.Eryk, Thanks for the detailed explanation. After I added attribute support to my extension class for stdio, the problem was resolved. Regards, Krishnan On Fri, Jan 6, 2017 at 9:24 AM, eryk sun wrote: > On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan

Re: Forcing prompt to be on newline when embedding Python with

2017-01-06 Thread eryk sun
On Thu, Jan 5, 2017 at 7:09 AM, H Krishnan wrote: > > I am working on embedding Python in my application. You forgot to tell us the version of Python that you're embedding. > I have redirected sys.stdin and sys.stdout to call methods from a Qt TextEdit > widget. Everything

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

2017-01-06 Thread H Krishnan
Hello Mr.Eryk, Thanks for the detailed explanation. After I added attribute support to my extension class for stdio, the problem was resolved. Regards, Krishnan On Fri, Jan 6, 2017 at 9:24 AM, eryk sun wrote: > On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan

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

2017-01-05 Thread eryk sun
On Fri, Jan 6, 2017 at 1:06 AM, H Krishnan wrote: > I tried replacing sys.displayhook with a function that does not print > newline but the newline still got inserted. So, I am not sure where the > newline is coming from. In any case, I could override sys.displayhook to add >

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

2017-01-05 Thread H Krishnan
Thanks for your help. > > > > > I am working on embedding Python in my application. > > You forgot to tell us the version of Python that you're embedding. > > I am using Python2.7. > > I have redirected sys.stdin and sys.stdout to call methods from a Qt > TextEdit > > widget. Everything works

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

2017-01-05 Thread eryk sun
On Thu, Jan 5, 2017 at 7:09 AM, H Krishnan wrote: > > I am working on embedding Python in my application. You forgot to tell us the version of Python that you're embedding. > I have redirected sys.stdin and sys.stdout to call methods from a Qt TextEdit > widget. Everything

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

2017-01-05 Thread H Krishnan
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__',