# Importing and using class from .py into a custom scripted module

**URL:** <https://discourse.slicer.org/t/importing-and-using-class-from-py-into-a-custom-scripted-module/11221>\
**Category:** Development\
**Created:** [April 21, 2020, 9:21am UTC](https://discourse.slicer.org/t/importing-and-using-class-from-py-into-a-custom-scripted-module/11221 "2020-04-21T09:21:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 21, 2020, 3:34pm UTC](https://discourse.slicer.org/t/importing-and-using-class-from-py-into-a-custom-scripted-module/11221/2 "2020-04-21T15:34:52Z")

</div>

> [@laura.gelcano](#):
>
> This TripleMRNet.py is in the same directory as the scripted module.

Slicer expects all .py files in a scripted module folder to be Slicer module, so you need to put all additional files into regular [Python packages](https://realpython.com/python-modules-packages/#python-packages) in subfolders. See [Extension wizard module](https://github.com/Slicer/Slicer/tree/master/Modules/Scripted/ExtensionWizard) and its ExtensionWizardLib package as an example.

The only complication is that you need to implement dynamic reloading of custom packages, if you want to reload your module without restarting Slicer. See this post for details: [Python scripted module development reload feature for multiple files - #4 by lassoan](https://discourse.slicer.org/t/python-scripted-module-development-reload-feature-for-multiple-files/6363/4)

---

_[View the full topic](https://discourse.slicer.org/t/importing-and-using-class-from-py-into-a-custom-scripted-module/11221)._
