pydoc > compileall

📘 Help on module compileall:

📛 NAME

compileall - Module/script to byte-compile all .py files to .pyc files.

🚀 Quick Reference

Use CaseCommandDescription
Compile a directory recursivelypython -m compileall <dir>Byte-compile all .py files in directory tree
Compile without recursionpython -m compileall -l <dir>Compile only top-level .py files
Force recompilationpython -m compileall -f <dir>Force compilation even if timestamps are up-to-date
Quiet mode (errors only)python -m compileall -q <dir>Suppress normal output, show only errors
Silent modepython -m compileall -qq <dir>No output at all
Parallel compilationpython -m compileall -j <N> <dir>Use N parallel workers
Produce legacy pyc pathspython -m compileall -l <dir>Use PEP 3147-incompatible paths
Compile all modules on sys.pathpython -m compileallCompile all modules in sys.path directories (no recursion)

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/compileall.html

The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.

📖 DESCRIPTION

When called as a script with arguments, this compiles the directories given as arguments recursively; the -l option prevents it from recursing into directories.

Without arguments, it compiles all modules on sys.path, without recursing into subdirectories. (Even though it should do so for packages — for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.

⚙️ FUNCTIONS

🔹 compile_dir(dir, maxlevels=None, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)

Byte-compile all modules in the given directory tree.

Arguments (only dir is required):

🔹 compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False)

Byte-compile one file.

Arguments (only fullname is required):

🔹 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.

Arguments (all optional):

📊 DATA

__all__ = ['compile_dir', 'compile_file', 'compile_path']

📁 FILE

/usr/lib/python3.10/compileall.py

compileall
📛 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 📖 DESCRIPTION ⚙️ FUNCTIONS
🔹 compile_dir(dir, maxlevels=None, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, workers=1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False) 🔹 compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1, invalidation_mode=None, *, stripdir=None, prependdir=None, limit_sl_dest=None, hardlink_dupes=False) 🔹 compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, legacy=False, optimize=-1, invalidation_mode=None)
📊 DATA 📁 FILE

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-01 16:55 @216.73.216.239
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^