Skip to content

Instantly share code, notes, and snippets.

View jeremylowery's full-sized avatar

Jeremy Lowery jeremylowery

  • EHO
  • Temple, TX
View GitHub Profile
@jeremylowery
jeremylowery / pkg-diff.py
Created May 17, 2016 15:36
Ubuntu: Show version by version comparison of manually installed packages in current distribution with another distribution
#!/usr/bin/env python
""" Show the difference between the versions of manually installed
packages on this system with the given distribution.
"""
import re
import sys
def main():
if not distribution():
sys.stderr.write("Could not determine distribution from /etc/os-release\n")
@jeremylowery
jeremylowery / coroutine_generator_demo.py
Last active May 17, 2016 15:38
Demonstration of using python generators as coroutines to implement cooperative multi-tasking
"""
Demonstration of using python generators as coroutines to implement
cooperative multi-tasking. Catting multiple files in chunks to stdout.
There is room for much more generationization of operators, for example
implementing the yielding value as a Future.
Pass in a list of file names.
"""
import sys