Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Primarily working on www.AtomicKotlin.com

Bruce Eckel BruceEckel

💭
Primarily working on www.AtomicKotlin.com
View GitHub Profile
@BruceEckel
BruceEckel / VisitDirs.py
Created Dec 2, 2014
Trying to use Python context managers and streams together, but it doesn't work
View VisitDirs.py
import os, sys
from contextlib import contextmanager
from glob import glob
@contextmanager
def visitDir(d):
os.chdir(d)
yield d
os.chdir("..")
You can’t perform that action at this time.