# Issues separating logic, widget and main classes

**URL:** <https://discourse.slicer.org/t/issues-separating-logic-widget-and-main-classes/29204>\
**Category:** Development\
**Created:** [April 29, 2023, 12:15pm UTC](https://discourse.slicer.org/t/issues-separating-logic-widget-and-main-classes/29204 "2023-04-29T12:15:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![asyeda](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asyeda](https://discourse.slicer.org/u/asyeda)\
**Post date:** [May 8, 2023, 3:58pm UTC](https://discourse.slicer.org/t/issues-separating-logic-widget-and-main-classes/29204/3 "2023-05-08T15:58:03Z")

</div>

The logic class doesn’t actually use the widget, I had included it in the imports since I thought that may avoid the error. I have since removed it. I’ve added the widget class back to the main module file and kept the logic class in its own file based on [this thread](https://discourse.slicer.org/t/python-scripted-module-development-reload-feature-for-multiple-files/6363/6) stating that the widget must be in the main module file, and this works fine. [Another thread](https://discourse.slicer.org/t/is-it-possible-to-split-a-python-extension-into-multiple-files/21713/5) says that the widget can be kept in its own file, but I am having issues recreating it the same way.

Is there a way to keep the widget separate from the main module class, and if so, how can I correctly point to the right locations so the module class is aware of the widget?

---

_[View the full topic](https://discourse.slicer.org/t/issues-separating-logic-widget-and-main-classes/29204)._
