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

**URL:** https://discourse.slicer.org/t/how-to-get-real-time-python-script-or-command-when-you-operate-in-3d-slicer/32625
**Category:** Development
**Tags:** python
**Created:** [November 6, 2023, 3:04pm UTC](https://discourse.slicer.org/t/how-to-get-real-time-python-script-or-command-when-you-operate-in-3d-slicer/32625 "2023-11-06T15:04:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Chuan](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chuan](https://discourse.slicer.org/u/Chuan)
#### Post date: [November 6, 2023, 3:04pm UTC](https://discourse.slicer.org/t/how-to-get-real-time-python-script-or-command-when-you-operate-in-3d-slicer/32625/1 "2023-11-06T15:04:21Z")

</div>

Hi,

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.

Best,  
Chuan

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [November 6, 2023, 3:17pm UTC](https://discourse.slicer.org/t/how-to-get-real-time-python-script-or-command-when-you-operate-in-3d-slicer/32625/2 "2023-11-06T15:17:55Z")

</div>

No, there’s no feature like that currently.

We point people to the [Script Repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html) for examples, and [these instructions for finding the python code for GUI features](https://slicer.readthedocs.io/en/latest/developer_guide/python_faq.html#how-to-find-a-python-function-for-any-slicer-features).

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

---

<div class="post-metadata">

### Author: ![Chuan](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chuan](https://discourse.slicer.org/u/Chuan)
#### Post date: [November 7, 2023, 11:29am UTC](https://discourse.slicer.org/t/how-to-get-real-time-python-script-or-command-when-you-operate-in-3d-slicer/32625/3 "2023-11-07T11:29:41Z")

</div>

Thank you Pieper!  
Good to know that!
