In the IPython console in spyder the Kernel interrupt doesn't seem to be 
working. The following code will put you in an infinite, unbreakable loop:

In [1]: from time import sleep


In [2]: while True:

   ...: sleep(2)

   ...:


Clicking Ctrl-C has no effect, nor does using the "Interrupt Kernel" button 
on the top -right of the IPython console pane.
By contrast in the QtConsole itself I observe the expected behaviour when 
pressing Ctrl-C:


In [1]: from time import sleep


In [2]: while True:

   ...: sleep(2)

   ...: 

---------------------------------------------------------------------------

KeyboardInterrupt Traceback (most recent call last)

<ipython-input-2-4fdabcf7d3fc> in <module>()

1 while True:

----> 2 sleep(2)

3 


KeyboardInterrupt: 


In [3]: from IPython import sys_info; print(sys_info())

{'commit_hash': '681fd77',

'commit_source': 'installation',

'default_encoding': 'cp1252',

'ipython_path': 'C:\\dev\\bin\\Anaconda\\lib\\site-packages\\IPython',

'ipython_version': '2.1.0',

'os_name': 'nt',

'platform': 'Windows-7-6.1.7601-SP1',

'sys_executable': 'C:\\dev\\bin\\Anaconda\\python.exe',

'sys_platform': 'win32',

'sys_version': '2.7.5 |Anaconda 1.9.2 (64-bit)| (default, Jul 1 2013, 
12:37:52) [MSC v.1500 64 bit (AMD64)]'}



Suspiciously, when I start an IPython console in the Kernel tab in the 
Console pane I see the following message:


NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.


To exit, you will have to explicitly quit this process, by either sending

"quit" from a client, or using Ctrl-\ in UNIX-like environments.


To read more about this, see https://github.com/ipython/ipython/issues/2049



To connect another client to this kernel, use:

    --existing kernel-11532.json



Since this works in the IPython QtConsole would it be possible to get it 
working in Spyder as well?


As it is currently I'm doing a lot of IPython.parallel work where I need to 
be able to interrupt a parallel calculation (a loop, waiting on 
asynchronous results) and it's very annoying to lose my session if I want 
to do so.


Thanks,

Dave


-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to