Search - User list
Full Version: Import a custom script into PythonModule in HDA?
Root » Technical Discussion » Import a custom script into PythonModule in HDA?
alexmajewski
Here's what I'm trying to do:




I embedded a custom script in my HDA.

Is there a neat way to somehow execute/interact with logic from scripts adjacent to PythonModule? For example, I'd like to define a class in a separate script and then use it in PythonModule.
chris_g
yeah, certainly can be done.

assuming a have another script called "Editor_PythonModule"
import toolutils

# load in the other python modules in the OTL
editor = toolutils.createModuleFromSection(
    "editor", kwargs["type"], "Editor_PythonModule"
)

editor.blah()

can't remember where i found out how to do this.

cheers,
chrisg
alexmajewski
@chris_g I would have never discovered that on my own. Thank you very much, Chris! It works as expected.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB