How to load script in HelloPython tutorial?

@lassoan @pieper,

The HelloPython tutorial say to load HelloPython.py. Do I load it into Python Interactor? Or do I use a text editor? Which tool shall I use to make changes to the python code on a Windows system? Shall I use a Python editor, or is that a good tool integrated with Slicer?

Thanks

The HelloPython tutorial

To help us understand the context, which tutorial are you referring to ?

For reference, see Documentation/Nightly/Training - Slicer Wiki

OK, I realize my question was totally confusing after re-reading it. I have since finished the tutorial and now know how to load the script. However, I’m using NotePad++ to edit the HelloPython code, save it and then restart Slicer. Are there better tools for editing Python module code that integrates into Slicer and allows debugging and break points for example? Thanks.

I don’t use it myself, but yes, there are debuggers integrated with better editors.

https://www.slicer.org/wiki/Documentation/Nightly/Extensions/DebuggingTools

Note that in the context of Slicer modules/extension/customapp, they are usually two copies of each script:

  1. the ones available in the source tree
  2. the ones copied in the build tree after building the project

Since we do not yet support a “develop” mode where we have a single copy, this means that after you modified the files in the build directory, you have to make sure to integrate your changes back in the source tree.

As an IDE for Windows for Slicer Python module development, I would recommend PyCharm because it is a bit easier to set up and use. If you need a completely free version, you can use Visual Studio Code or Visual Studio. See detailed instructions here.