Python scripted module code organization

What is the recommended way to distribute and initiate source code in a scripted module - separating code into multiple files?

I am not sure about importing files. When I add into a scripted module folder to import all files within the module folder, then during the Slicer startup appears following error:

SystemError: /work/Stable/Slicer-4101-build/Python-2.7.13/Objects/classobject.c:521: bad argument to internal function

Slicer version: Slicer-4.10.1-linux-amd64

Python modules must be in subfolder(s). See for example how it is done in DataProbe module.

1 Like