compileall.compile_path
Prev: compileall.compile_file | Up: compileall
Rel: compileall.compile_dir, compileall.compile_file
Ref: docs.python.org — compileall.compile_path
Tags: #public #python3 #stdlib #compileall
Import
import compileall
from compileall import compile_path
Signature & Overview
compileall.compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, legacy=False, optimize=-1, invalidation_mode=None)
Byte-compile all module on sys.path.
Usage
import compileall
# Compiles all .py files found along sys.path (usually invoked via `python3 -m compileall`)
assert callable(compileall.compile_path)
Gotchas
- Avoid running without
skip_curdir=Truein large working trees; may fail on read-only systemsite-packagesdirectories.
REPL Inspect
from compileall import compile_path
help(compile_path)
Linked from
Related notes
- tuts/python3/stdlib_module/compileall/compile_dir Linked here; links to this page; shared tags: #compileall, #stdlib
- tuts/python3/stdlib_module/compileall/compile_file Linked here; links to this page; shared tags: #compileall, #stdlib
- tuts/python3/stdlib_module/compileall Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib
- tuts/c/stdlib/ctype/isdigit shared tags: #stdlib