Skip to content

Instantly share code, notes, and snippets.

View TrishGillett's full-sized avatar

Trish Gillett-Kawamoto TrishGillett

View GitHub Profile
@TrishGillett
TrishGillett / show_nb_inputs.py
Last active August 29, 2015 14:24 — forked from minrk/remove_output.py
When an ipython notebook is minorly corrupt or otherwise unopenable and you've exhausted other recovery options, you can try running this function to print out all of the code and headings in such a way that you could recreate the notebook by copy-pasting them into a fresh notebook. It's not super fun, but better than nothing in some cases.
"""
usage: python show_nb_inputs.py notebook.ipynb
"""
import sys
import io
from IPython.nbformat import current
#!/usr/bin/env python
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
DEBUG = 1
# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
def readadc(adcnum, clockpin, mosipin, misopin, cspin):