[IPython-user] Ctrl-C

Piotr Zolnierczuk piotr.zolnierczuk@gmail....
Fri Aug 21 13:48:55 CDT 2009


Yes - that would work if I were the only writer of these scripts.
 We have people who are not (yet) skilled python programmers and

What I have is an embedded ipython in a wxPython program and the only way I
see at the moment is to hack IPython directly and put the try block you
described.

Piotr


On Fri, Aug 21, 2009 at 2:31 PM, David Warde-Farley <dwf@cs.toronto.edu>wrote:

>
> On 21-Aug-09, at 10:20 AM, Piotr Zolnierczuk wrote:
>
> Hi,
>>
>> It would be nice if one could capture Ctrl-C with a custom handler.
>>
>> We often run “long” (10-800 minutes long) scripts that take automate data
>> taking and users sometimes just want to stop them before they are finished.
>> The traceback dump, while colorful, often scares inexperienced users and
>> clutters unnecessarily the screen.
>>
>
> try:
>        while True:
>                pass
> except KeyboardInterrupt:
>        print "Caught Ctrl+C"
>
> David




-- 

Piotr Adam Zolnierczuk
e-mail: piotr@zolnierczuk.net
www:   http://www.zolnierczuk.net
_____________________________________
written on recycled electrons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20090821/b9354833/attachment.html 


More information about the IPython-user mailing list