I don't use win32 at present.<br><br>I decided to get around screwy terminal by running my program under screen (1).<br>This works for me because I wanted to use IPython to monitor long-running processes/daemons, thus I had screen in mind from the start.
<br><br><div><span class="gmail_quote">On 7/30/07, <b class="gmail_sendername">Fernando Perez</b> <<a href="mailto:fperez.net@gmail.com">fperez.net@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
On 7/30/07, dima Q <<a href="mailto:dimaqq@gmail.com">dimaqq@gmail.com</a>> wrote:<br>> Hi<br>><br>> I'm trying to add ipython to a program where interactive interface is a very<br>> small part - I use it mostly for debugging. I want to be able to add ipython
<br>> in such a way that when the program decides to exit (due to gui action or<br>> network conditions), interactive interface exits too. I have ipython running<br>> in another thread.<br>><br>> branch 1:<br>
> I found a function shell.IP.exit(), and setting conirm_exit=False,<br>> however when I do these, ipython thread waits in readline()<br>> before actually exiting<br>><br>> branch 2:<br>> I set threading.Thread.setDaemon
(True) on the thread where I run ipython,<br>> however when thread program exits terminal is left in a broken state by<br>> readline<br>><br>> Any suggestions how I could implement what I want here?<br><br>Honestly I don't know. I do know that readline is finicky with
<br>threads, because in the past there have been thread-related bugs in<br>the core readline module (discovered by ipython users, in fact).<br>Those bugs were fixed long ago, but I mention it because it means that<br>readline and threads aren't necessarily a trivial mix.
<br><br>However, if you figure out a clean solution, by all means let us know,<br>and even better, post it on the cookbook:<br><br><a href="http://ipython.scipy.org/moin/Cookbook">http://ipython.scipy.org/moin/Cookbook</a>
<br><br>I'm sure others would find the information useful.<br><br>As Ville said, it's possible that under Win32 something better could<br>be done, since we have full control over readline there. But on POSIX<br>where we ride on Python's readline, I just don't know, sorry.
<br><br>Cheers,<br><br>f<br></blockquote></div><br>