# Load ScriptedModule using python scripts

**URL:** <https://discourse.slicer.org/t/load-scriptedmodule-using-python-scripts/35984>\
**Category:** Development\
**Created:** [May 8, 2024, 7:26am UTC](https://discourse.slicer.org/t/load-scriptedmodule-using-python-scripts/35984 "2024-05-08T07:26:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![park](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/park/32/5717_2.png) [@park](https://discourse.slicer.org/u/park)\
**Post date:** [May 8, 2024, 7:26am UTC](https://discourse.slicer.org/t/load-scriptedmodule-using-python-scripts/35984/1 "2024-05-08T07:26:34Z")

</div>

Hi all,

For security reasons, we want to place our module on a web server and use web APIs to read it when Slicer is opened. This way, we can identify who called the module and execute it without downloading the source code to the local computer.

* * *

We are attempting a simple test implementation for this by trying to load the scripted module using Python programming (etc console).

After examining the C++ source code, it seems like `imp.load_source` is being used, but attempting it in the console doesn’t seem to work well. Can we get some insights on this?

Specifically, when apply `imp.load_source('MyModule', 'Path\MyModule.py')`, the `MyModuleLibs` was not integrated in the `load_source` process.
