This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import matplotlib.pyplot as plt | |
def connect_close(figure=None): | |
def press_key(event): | |
if event.key == 'escape': | |
plt.close('all') | |
sys.exit(0) | |
if not figure: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class TimedExecution(object): | |
def __init__(self, enter_message=None, exit_message=None): | |
self.enter_message = enter_message | |
self.exit_message = exit_message | |
def __enter__(self): | |
if self.enter_message: |