How to get real-time python script or command when you operate in 3D slicer


I would like to discuss is it possible for 3D slicer to generate real-time python code when you do some operation in 3D slicer?
I know we can give python codes to 3D slicer through python interactor. But as a beginner, I would like to learn how to write it. For example, when I save my file, I hope I can see the corresponding code somewhere. Then I know, ‘ok! This is the command for save!’

I hope I make my question cleary, and very thankful for your discussion.


No, there’s no feature like that currently.

We point people to the Script Repository for examples, and these instructions for finding the python code for GUI features.

People also sometimes find ChatGPT and similar tools helpful to generate code.

1 Like

Thank you Pieper!
Good to know that!