I’m trying to add some functionality to Slicer, and I want to make a couple of separate modules which will use the same underlying libraries. It’s not clear to me if there’s a nice way to do this without explicit sys.path manipulation.
My hope is to be able to include both the separate modules, and their common infrastructure, in a single extension, but that is not a hard requirement.
If one module provides a set of libraries it should be available to other modules that are loaded in the same Slicer session (e.g. import the Logic class from another module). You should never need to duplicate code or manipulate any python path variables manually.
Hey,
I should chime-in since you referenced a topic I posted previously. In my case I have a custom library that was shared by two separate applications - a TCP/IP socket class. Let’s call it sock.py
to use sock.py in a slicer scripted module I had to setup the directory structure as so