You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Gurobi Optimization
Hi,
I am looking for a reliable way to execute code when a Python program solving LPs with Gurobi is interrupted with CTRL-C. Two possible ways to do that in Python are (i) by handling KeyboardInterrupt exceptions or (ii) by using the atexit Python module and atexit.register(). While this works for simple Python programs with one call to Gurobi for solving a MIP, it does not work reliably in a more complex program with callbacks and multiple calls to optimize() for LPs (not MIPs). I have tried both ways, both work sometimes but usually not (depending on when I press CTRL-C). What am I missing?