Skip to main content

module_file

Return the correct original file name of a module.

def module_file(
module: module
) - > string

Return the correct original file name of a module.

Parameters​

NameTypeDescription
modulemoduleThe Python module object whose file path is to be retrieved

Returns​

TypeDescription
stringThe absolute path to the module's source file, ensuring .pyc extensions are normalized to .py