8000 Catch KeyboardInterrupt and exit normally · Issue #54 · zdict/zdict · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Catch KeyboardInterrupt and exit normally #54

Open
pi314 opened this issue Oct 21, 2015 · 10 comments
Open

Catch KeyboardInterrupt and exit normally #54

pi314 opened this issue Oct 21, 2015 · 10 comments
Assignees

Comments

@pi314
Copy link
Collaborator
pi314 commented Oct 21, 2015

For better user experience

@iblislin
Copy link
Member

Currently we do it already

@pi314
Copy link
Collaborator Author
pi314 commented Oct 21, 2015

But...
2015-10-21 23 55 15

@iblislin
Copy link
Member

Oh... we only catch it on shell mode

@pi314 pi314 self-assigned this Oct 21, 2015
@pi314
Copy link
Collaborator Author
pi314 commented Oct 21, 2015

Looks like I have something to contribute (thumbsup)

@iblislin
Copy link
Member

👍

1 similar comment
@wdv4758h
Copy link
Member

👍

@wdv4758h wdv4758h added the UX label Oct 21, 2015
@fkztw
Copy link
Member
fkztw commented Oct 21, 2015

I don't get it.
How are you going to implement this feature?
This exception can happen in anywhere depends on the timing you press ^C
You can try it a little more times then you will know.
It's just like you cancel the program even before it starts.
Just like u type ipython and press ^C before the prompt shows up.

@fkztw
Copy link
Member
fkztw commented Oct 23, 2015

Can @pi314 reply my question above? I really want to know how to do it.
The pic you gave above showed the KeyboardInterrupt happened while importing the argparse module.

The most closed solution I can imagine is that we add a singal handler in the scripts/zdict even before the line from zdict import zdict but I don't think it's a good solution.

@pi314
Copy link
Collaborator Author
pi314 commented Oct 23, 2015

@M157q: Well, I was going to catch exceptions on zdict.lookup(), but I didn't found that my screenshot shows it explode on argparse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
0