Skip to content

Instantly share code, notes, and snippets.

@jkeyes
Last active August 29, 2015 14:00
Show Gist options
  • Save jkeyes/11049632 to your computer and use it in GitHub Desktop.
Save jkeyes/11049632 to your computer and use it in GitHub Desktop.
Quickie to compile Python modules
import compileall
sys.exit(not compileall.compile_dir('modules_dir', quiet=1))
import py_compile
import sys
try:
py_compile.compile('file.py', doraise=True)
sys.exit(0)
except py_compile.PyCompileError, pe:
print pe
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment