On this page
  1. compileall.compile_path
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from compileall import compile_path
help(compile_path)

Linked from

Related notes