Skip to content

Instantly share code, notes, and snippets.

View martinth's full-sized avatar

Martin Thurau martinth

View GitHub Profile
@martinth
martinth / argparse_fileinput_demo.py
Created August 6, 2015 11:04
Read from stdin or files in Python (combining argparse and fileinput)
import argpase
import fileinput
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--dummy', help='dummy argument')
parser.add_argument('files', metavar='FILE', nargs='*', help='files to read, if empty, stdin is used')
args = parser.parse_args()
# If you would call fileinput.input() without files it would try to process all arguments.
from pympler import summary, muppy
import psutil
# source: http://www.mobify.com/blog/sqlalchemy-memory-magic/
def get_virtual_memory_usage_kb(): # pragma: no cover
"""
The process's current virtual memory size in Kb, as a float.
"""
@martinth
martinth / Dota 2 winrates.ipynb
Created August 31, 2015 09:55
Dota 2 winrates 6.84 pro and pub
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function test() {
}