<br><br><div class="gmail_quote">2011/9/13 Omar Andrés Zapata Mesa <span dir="ltr"><<a href="mailto:andresete.chaos@gmail.com">andresete.chaos@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

hi all.<div>Doing some tests in the zmq frontend I find the next things</div><div>from minrk repo  git://<a href="http://github.com/minrk/ipython.git" target="_blank">github.com/minrk/ipython.git</a> in the branch termzmq</div>



<div><br></div>
<div>->open a new kernel but not using  ipython/IPython/frontend/zmqterminal/app.py </div><div>just run python -c "from IPython.zmq.ipkernel import main; main()"</div></blockquote><div><br></div><div>You can start a kernel with just `ipython kernel`</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br></div><div><div> python -c "from IPython.zmq.ipkernel import main; main()"</div>


<div>[IPKernelApp] To connect another client to this kernel, use:</div><div>[IPKernelApp] --existing --shell=49587 --iopub=57815 --stdin=55774 --hb=33990</div></div><div><br></div><div>if you press crtl+c the kernel output is </div>




<div>^CKeyboardInterrupt caught in kernel</div><div>that is right!!</div><div><br></div><div>-> open in other console </div><div>python app.py  --existing --shell=49587 --iopub=57815 --stdin=55774 --hb=33990</div></blockquote>

<div><br></div><div>Also, this can be started with just `ipython zmq ...`</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>


<br></div><div>and press crtl+c</div><div>output </div><div><div><br></div><div>KeyboardInterrupt</div><div>---------------------------------------------------------------------------</div><div>RuntimeError                              Traceback (most recent call last)</div>




<div>/usr/local/lib/python2.6/dist-packages/IPython/frontend/terminal/interactiveshell.pyc in raw_input(self, prompt)                                                        </div><div>    338 </div><div>    339         try:</div>




<div>--> 340             line = raw_input_original(prompt).decode(self.stdin_encoding)</div><div>    341         except ValueError:</div><div>    342             warn("\n********\nYou or a %run:ed script called sys.stdin.close()"</div>




<div><br></div><div>/home/omazapa/MyProjects/ipython/IPython/frontend/zmqterminal/app.py in handle_sigint(self, *args)                                                                      </div><div>    143         # FIXME: this doesn't work, the kernel just dies every time</div>




<div><br></div><div>    144         self.shell.write('KeyboardInterrupt\n')</div><div>--> 145         self.kernel_manager.interrupt_kernel()</div><div>    146 </div><div>    147     def init_code(self):</div><div>




<br></div><div>/usr/local/lib/python2.6/dist-packages/IPython/zmq/kernelmanager.pyc in interrupt_kernel(self)                                                                          </div><div>    916                 self.kernel.send_signal(signal.SIGINT)</div>




<div>    917         else:</div><div>--> 918             raise RuntimeError("Cannot interrupt kernel. No kernel is running!")                                                                                </div>




<div>    919 </div><div>    920     def signal_kernel(self, signum):</div><div><br></div><div>RuntimeError: Cannot interrupt kernel. No kernel is running!</div></div><div><br></div><div>-> it produces a ugly traceback but the kernel is not die.</div>




<div>-> any know why is tell me that  No kernel is running? (but the kernel is running)</div><div>-> calling ipkernel directly show the next traceback</div></blockquote><div><br></div><div>External frontends cannot interrupt the kernel, because they know nothing about the kernel apart from its zmq ports.  In the long run, we need to split the existing KernelManager into a thin KernelParent that starts, interrupts, and restarts, and a KernelClient that is actually used in frontends to issue commands.  Doing this will allow interrupt and restart from all frontends, rather than just the owner.</div>

<div><br></div><div>Obviously, the traceback shouldn't happen, but the interrupt behavior in general in the terminal frontend is quite wrong at the moment, and the principal part of that code in need of further development.</div>

<div><br></div><div>-MinRK</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br></div><div><br></div><div>-- <br>Omar Andres Zapata Mesa<div>


Head Developer P<font face="arial, helvetica, sans-serif"><span style="font-size:13px;line-height:19px;white-space:pre-wrap">henomenology of Fundamental Interactions Group</span> (Gfif)</font></div><div><font face="arial, helvetica, sans-serif"><a href="http://gfif.udea.edu.co" target="_blank">http://gfif.udea.edu.co</a><br>




</font></div><div>Division of computer science Gfif Developers (Gfif Dev)</div><div><a href="http://gfifdev.udea.edu.co/" target="_blank">http://gfifdev.udea.edu.co</a></div><div><div>Systems Engineering Student</div><div>




Universidad de Antioquia At Medellin - Colombia</div><div>Usuario Linux  #490962</div></div><br>
</div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br>