Skip to content

Instantly share code, notes, and snippets.

View davidchall's full-sized avatar

David C Hall davidchall

View GitHub Profile
@benjeffery
benjeffery / mat2png.py
Last active August 29, 2015 14:15
mat2png
#USAGE: python mat2png FILENAME.mat MATRIXNAME
import h5py
import sys
import png
import numpy as np
mat = h5py.File(sys.argv[1], 'r')
print mat['OutputStructure'].keys()
print mat['OutputStructure']['PreProcess'].keys()
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@sampsyo
sampsyo / subcommand.py
Created July 3, 2010 17:37
subcommand support for Python's optparse
"""A simple addition to Python's optparse module supporting subcommands
like those found in the svn or hg CLIs.
To use it, instantiate the Subcommand class for every subcommand you
want to support. Each subcommand has a name, aliases, a help message,
and a separate OptionParser instance. Then pass a list of Subcommands
to the constructor of SubcommandsOptionParser to make a subcommand-
aware parser. Calling parse_args on that parser gives you the
subcommand invoked, the subcommand's arguments and options, and the
global options all in one fell swoop. See the smoke test at the bottom