title: Interrupting boost python C++ routine
body: <p>I have written an application with PyQt5 for Windows and I have C++ modules embedded with boost python. One of my C++ routines performs an optimization. It can happen that an optimization does not converge. In that case, I would like to have a possibility to interrupt the routine rather than wait until the max iterations are exceeded. So I need a way to catch Ctrl-C inside the C++ routine so that I can take corresponding action. How can I catch Ctrl-C in this case?</p>