Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""Emulate bash:
$ cat /tmp/fifo.tub &
$ gunzip -c /tmp/filedata.dat.gz > /tmp/fifo.tub
http://stackoverflow.com/questions/19859283/python-subprocess-hangs-with-named-pipes
"""
import os
from contextlib import contextmanager
@drevicko
drevicko / 2to3_nb.py
Created August 9, 2017 11:19 — forked from takluyver/2to3_nb.py
Run 2to3 on IPython notebooks
#!/usr/bin/env python3
"""
To run: python3 nb2to3.py notebook-or-directory
"""
# Authors: Thomas Kluyver, Fernando Perez
# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80
import argparse
import pathlib
from nbformat import read, write