Skip to content

Instantly share code, notes, and snippets.

View GadgetSteve's full-sized avatar

Steve (Gadget) Barnes GadgetSteve

  • Bridgend, UK
View GitHub Profile
@GadgetSteve
GadgetSteve / timed_sshot.py
Created July 13, 2017 09:17
Demo of timed screenshots
import datetime
import date
import pyscreenshot
INTERVAL = 30 # Time in seconds between screenshots
while True:
now = datetime.datetime.now() # Get timestamp
filename = now.strftime('screenshot_%Y_%m_%d_%H_%M_%S.png') # Create a filename
pyscreenshot.grab_to_file(filename) # take the screenshot
time.sleep(INTERVAL)
@GadgetSteve
GadgetSteve / dump_licences.py
Created October 23, 2016 09:28
Dump out a grouped list of the licences of the installed packages
"""
This gist should allow you to print a dictionary of licence types that you have installed
with a list the packages using each licence.
"""
from __future__ import print_function
import pip
import collections
info = [i for i in pip.commands.show.search_packages_info([ # takes a list of the names as a parameter
d.project_name for d in pip.utils.get_installed_distributions() # This should give us a list of the installed package names
@GadgetSteve
GadgetSteve / Medals_2016_mpl.ipynb
Last active August 12, 2016 07:02
A Rough & Ready 2016 Medal Notebook View
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.