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 | |
| from PyQt5.QtWidgets import QApplication | |
| from PyQt5.QtSvg import QSvgWidget | |
| from io import BytesIO | |
| import matplotlib.pyplot as plt | |
| # matplotlib: force computer modern font set | |
| plt.rc('mathtext', fontset='cm') |
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
| #!/usr/bin/env python3 | |
| """Easily put time restrictions on things | |
| Note: Requires Python 3.x | |
| Usage as a context manager: | |
| ``` | |
| with timeout(10): | |
| something_that_should_not_exceed_ten_seconds() | |
| ``` |