First time here? Check out the FAQ!
2

Trapping sigint to ask for a key press
 

The script that I'm working on is going to run for a long time. It's purpose is to identify and delete certain messages from a mailbox, then call imapclient.expunge() when complete. I have written a signal handler to trap SIGINT and ask the user what he wants to do next.

When I run the script in Wing IDE (6.0.12-1) the interrupt handler never gets called. I assume that Wing is hooking the SIGINT signal itself. Suggestions on how I can work around this (other than trapping some other signal)?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Dan Mahoney's avatar
21
Dan Mahoney
asked 6 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 6 years ago

Comments

see more comments

1 Answer

2

If you are pressing Ctrl-C in Wing that ends up not sending SIGINT but may copy or something else depending on keyboard personality.  If you want to do this in Wing you probably need to configure the debugger to use an external console, which is done from the Debug I/O tool's Options menu.  Then pressing Ctrl-C in the separate console window should work.  Please let me know if that doesn't help.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 6 years ago
link

Comments

see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)