# Is it possible to split a python extension into multiple Files?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-split-a-python-extension-into-multiple-files/21713>\
**Category:** Development\
**Tags:** python\
**Created:** [January 31, 2022, 3:15pm UTC](https://discourse.slicer.org/t/is-it-possible-to-split-a-python-extension-into-multiple-files/21713 "2022-01-31T15:15:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tsims](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tsims/32/11853_2.png) [@tsims](https://discourse.slicer.org/u/tsims)\
**Post date:** [February 1, 2022, 2:04pm UTC](https://discourse.slicer.org/t/is-it-possible-to-split-a-python-extension-into-multiple-files/21713/5 "2022-02-01T14:04:14Z")

</div>

Thank you both so much for the help, I was able to figure everything out with this advice!

For splitting the Widget and Logic classes to different files, I just had to make sure that I pointed to the right locations from the main plugin file as well!

e.g.  
Module.py

```auto
import ModuleLib.Widget as mw

class Module(ScriptedLoadableModule):
    ...

ModuleWidget = mw

```

---

_[View the full topic](https://discourse.slicer.org/t/is-it-possible-to-split-a-python-extension-into-multiple-files/21713)._
