#! /usr/bin/env python import os from compileall import compile_dir dirs = ['Sketch', 'Plugins', 'Pax'] map(compile_dir, map(os.path.join, [os.getcwd()] * len(dirs), dirs))