For inline links, do this Link text
This is a paragraph that contains a link.
Here's a code block:
import os | |
import logging | |
import sys | |
import time | |
import traceback | |
from mypackage import __version__ | |
def _exception_handler(error_type, error_value, error_traceback): |
import numpy as np | |
import inspect | |
from skimage import exposure, feature, filters, measure, morphology, \ | |
restoration, segmentation, transform, util | |
def only_one_nondefault(args): | |
""" | |
Returns True if the function has only one non-keyword parameter, | |
False otherwise. |
# To generate baseline images | |
py.test --mpl-generate-path=baseline | |
# To run pytest with the matplotlib plugin | |
py.test --mpl | |
# See full details here | |
# https://github.com/matplotlib/pytest-mpl |
For the whole repository: | |
$ 2to3 --output-dir=python3-version/mycode -W -n python2-version/mycode | |
For a single file: | |
$ 2to3 filename.py | |
# See details at: | |
# https://docs.python.org/2/library/2to3.html | |
# Stack overflow |
# Installing a python wheel | |
pip install some-package.whl | |
# Creating a python wheel | |
pip wheel --wheel-dir=path/to/save/wheel wheel_filename | |
# See https://python101.pythonlibrary.org/chapter39_wheels.html | |
# PEP427 (describes the wheel format) |
# Sphinx docs | |
docs/_build | |
# Logging | |
logs/* | |
!logs/.gitkeep | |
# Testing and coverage | |
cov.xml | |
.pytest_cache/ |
# Build a wheel (outputs to dist/ directory) | |
python setup.py sdist bdist_wheel | |
# Build with pyinstaller | |
pyinstaller myfile.spec -w -F -y | |
## If no spec file currently exists | |
pyinstaller mypackage/main.py |
"""Example of a non-blocking PyQt while loop callback using threading | |
Example adapted from this StackOverflow answer: | |
https://stackoverflow.com/questions/22340230/python-pyqt-how-run-while-loop-without-locking-main-dialog-window?answertab=votes#tab-top | |
Ported from PyQt4 to PyQt5 using the tool pyqt4topyqt5: | |
https://github.com/rferrazz/pyqt4topyqt5 | |
""" | |
import os |
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
from PyQt5.QtCore import Qt | |
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter | |
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter | |
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \ | |
qApp, QFileDialog | |