compileall
Stdlib — IntrospectionPython 2.0+Advanced
Byte-compile all .py files in a directory tree
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
- Dependencies
- None — Python Standard Library
- Install
Included with Python
Learn by Difficulty
Quick Example
python
import compileall print(f"Module: compileall") print(f"Contents: {dir(compileall)[:10]}")
The compileall module is part of Python's standard library. Byte-compile all .py files in a directory tree.
Try in PlaygroundTags
stdlibintrospectionmetaprogramming