{
    "mode": "pydoc",
    "parameter": "runpy",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/runpy/json",
    "generated": "2026-06-02T15:03:08Z",
    "sections": {
        "NAME": {
            "content": "runpy - runpy.py - locating and running Python code using the module namespace\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/runpy.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": "Provides support for locating and running Python scripts using the Python\nmodule namespace instead of the native filesystem.\n\nThis allows Python code to play nicely with non-filesystem based PEP 302\nimporters when locating support scripts as well as when importing modules.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "run_module",
                    "content": "Execute a module's code without importing it.\n\nmodname -- an absolute module name or package name.\n\nOptional arguments:\ninitglobals -- dictionary used to pre-populate the module’s\nglobals dictionary before the code is executed.\n\nrunname -- if not None, this will be used for setting name;\notherwise, name will be set to modname + 'main' if the\nnamed module is a package and to just modname otherwise.\n\naltersys -- if True, sys.argv[0] is updated with the value of\nfile and sys.modules[name] is updated with a temporary\nmodule object for the module being executed. Both are\nrestored to their original values before the function returns.\n\nReturns the resulting module globals dictionary.\n"
                },
                {
                    "name": "run_path",
                    "content": "Execute code located at the specified filesystem location.\n\npathname -- filesystem location of a Python script, zipfile,\nor directory containing a top level main.py script.\n\nOptional arguments:\ninitglobals -- dictionary used to pre-populate the module’s\nglobals dictionary before the code is executed.\n\nrunname -- if not None, this will be used to set name;\notherwise, '<runpath>' will be used for name.\n\nReturns the resulting module globals dictionary.\n"
                }
            ]
        },
        "DATA": {
            "content": "all = ['runmodule', 'runpath']\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/runpy.py\n\n",
            "subsections": []
        }
    },
    "summary": "runpy - runpy.py - locating and running Python code using the module namespace",
    "flags": [],
    "examples": [],
    "see_also": []
}