{
    "mode": "pydoc",
    "parameter": "compileall",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/compileall/json",
    "generated": "2026-06-02T13:22:30Z",
    "sections": {
        "NAME": {
            "content": "compileall - Module/script to byte-compile all .py files to .pyc files.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/compileall.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "When called as a script with arguments, this compiles the directories\ngiven as arguments recursively; the -l option prevents it from\nrecursing into directories.\n\nWithout arguments, if compiles all modules on sys.path, without\nrecursing into subdirectories.  (Even though it should do so for\npackages -- for now, you'll have to deal with packages separately.)\n\nSee module pycompile for details of the actual byte-compilation.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "compile_dir",
                    "content": "Byte-compile all modules in the given directory tree.\n\nArguments (only dir is required):\n\ndir:       the directory to byte-compile\nmaxlevels: maximum recursion level (default `sys.getrecursionlimit()`)\nddir:      the directory that will be prepended to the path to the\nfile as it is compiled into each byte-code file.\nforce:     if True, force compilation, even if timestamps are up-to-date\nquiet:     full output with False or 0, errors only with 1,\nno output with 2\nlegacy:    if True, produce legacy pyc paths instead of PEP 3147 paths\noptimize:  int or list of optimization levels or -1 for level of\nthe interpreter. Multiple levels leads to multiple compiled\nfiles each with one optimization level.\nworkers:   maximum number of parallel workers\ninvalidationmode: how the up-to-dateness of the pyc will be checked\nstripdir:  part of path to left-strip from source file path\nprependdir: path to prepend to beginning of original file path, applied\nafter stripdir\nlimitsldest: ignore symlinks if they are pointing outside of\nthe defined path\nhardlinkdupes: hardlink duplicated pyc files\n"
                },
                {
                    "name": "compile_file",
                    "content": "Byte-compile one file.\n\nArguments (only fullname is required):\n\nfullname:  the file to byte-compile\nddir:      if given, the directory name compiled in to the\nbyte-code file.\nforce:     if True, force compilation, even if timestamps are up-to-date\nquiet:     full output with False or 0, errors only with 1,\nno output with 2\nlegacy:    if True, produce legacy pyc paths instead of PEP 3147 paths\noptimize:  int or list of optimization levels or -1 for level of\nthe interpreter. Multiple levels leads to multiple compiled\nfiles each with one optimization level.\ninvalidationmode: how the up-to-dateness of the pyc will be checked\nstripdir:  part of path to left-strip from source file path\nprependdir: path to prepend to beginning of original file path, applied\nafter stripdir\nlimitsldest: ignore symlinks if they are pointing outside of\nthe defined path.\nhardlinkdupes: hardlink duplicated pyc files\n"
                },
                {
                    "name": "compile_path",
                    "content": "Byte-compile all module on sys.path.\n\nArguments (all optional):\n\nskipcurdir: if true, skip current directory (default True)\nmaxlevels:   max recursion level (default 0)\nforce: as for compiledir() (default False)\nquiet: as for compiledir() (default 0)\nlegacy: as for compiledir() (default False)\noptimize: as for compiledir() (default -1)\ninvalidationmode: as for compilerdir()\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['compiledir', 'compilefile', 'compilepath']\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/compileall.py\n\n",
            "subsections": []
        }
    },
    "summary": "compileall - Module/script to byte-compile all .py files to .pyc files.",
    "flags": [],
    "examples": [],
    "see_also": []
}