The interp module contains utility functions related to the Python
interpreter itself: starting a script in an existing interpreter, loading
a specific file as a module, frame hack utilities, that sort of
things.
|
runScript(scriptPath,
args=[])
Runs the given python file scriptPath as a script (not as a
module) providing it the given command-line arguments args. |
|
|
module
|
loadModule(filePath,
compile=True,
reload=False)
Loads a specific Python file as a module. |
|
|
dict
|
|
dict
|
|
list
|
|
list
|
|
imp.PY_SOURCE, imp.PY_COMPILED, imp.C_EXTENSION or None
|
getModuleTypeFromExtension(ext)
Gets the module type associated with the given file extension or None
if the extension is not recognized on this platform. |
|
|
str
|
getCompiledFilePath(filePath)
Gets the path of the compiled Python file generated by the
interpreter when the specified Python file is imported. |
|
|
str
|
getOptimizedFilePath(filePath)
Gets the path of the compiled optimized Python file generated by the
interpreter when the specified Python file is imported in optimize
mode. |
|
|
str
|
getModuleNameFromPath(filePath)
Gets a unique module name from a file path which is composed of the
file basename suffixed by an hex representation of the normalized
absolute path of the file. |
|
|
str
|
|
str
|
getObjectName(o)
Returns:
The name of the given object (__name__ attribute). |
|
|
str
|
getObjectModuleName(o)
Returns:
The name of the module in which the object was defined (__module__
attribute). |
|
|
str
|
getModulePath(moduleName)
Returns:
The path of the file from which the module with the given name was
loaded. |
|
|