Skip to content

Instantly share code, notes, and snippets.

View BruceEckel's full-sized avatar
💭
Primarily working on Effect-Oriented Programming

Bruce Eckel BruceEckel

💭
Primarily working on Effect-Oriented Programming
View GitHub Profile
@BruceEckel
BruceEckel / VisitDirs.py
Created December 2, 2014 18:59
Trying to use Python context managers and streams together, but it doesn't work
import os, sys
from contextlib import contextmanager
from glob import glob
@contextmanager
def visitDir(d):
os.chdir(d)
yield d
os.chdir("..")