Scripted/cli Python module

Hi all,
I was wondering if it is possible to write a scripted Python module that can be used both via GUI and command line.

Thanks a lot.


Hi Paolo -

Sure, you should be able to add a cli wrapper that uses the same logic classes as a a module’s GUI uses. If it’s just python code it could use any python or if you have dependencies you could either use PythonSlicer or Slicer --no-splash --no-main-window to run it.

Thanks a lot @pieper!
I got it.