pydpeet.load_custom_module#

Functions

load_custom_module(folder_path, module_name)

Loads a custom Python module from a specified folder.

pydpeet.load_custom_module.module_from_spec(spec)[source]#

Create a module based on the provided spec.

pydpeet.load_custom_module.spec_from_file_location(name, location=None, *, loader=None, submodule_search_locations=<object object>)[source]#

Return a module spec based on a file location.

To indicate that the module is a package, set submodule_search_locations to a list of directory paths. An empty list is sufficient, though its not otherwise useful to the import system.

The loader must take a spec as its only __init__() arg.

pydpeet.load_custom_module.ModuleType#

alias of ModuleType

pydpeet.load_custom_module.load_custom_module(folder_path, module_name)[source]#

Loads a custom Python module from a specified folder.

Parameters: folder_path (str): The path to the folder containing the module file. module_name (str): The name of the module to load (without the .py extension).

Returns: module: The loaded Python module object.

Raises: FileNotFoundError: If the module file does not exist in the specified folder.

Parameters:
  • folder_path (str)

  • module_name (str)

Return type:

ModuleType