Last active
August 29, 2015 14:00
-
-
Save jkeyes/11049632 to your computer and use it in GitHub Desktop.
Quickie to compile Python modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import compileall | |
sys.exit(not compileall.compile_dir('modules_dir', quiet=1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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