# Editor for .py files is now configurable

**URL:** <https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563>\
**Category:** Development\
**Tags:** feature\
**Created:** [July 12, 2023, 7:08pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563 "2023-07-12T19:08:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 12, 2023, 7:08pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/1 "2023-07-12T19:08:46Z")

</div>

Until recently, when a developer clicked the `Edit` button in the module’s `Reload & Test` section, Slicer opened the Python file of the module using the program associated with Python files in the operating system settings.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/0/b01ccb3dc990583553e3a1224749554b9eea1d4e.png)

However, sometimes the operating system settings did not have any program associated with Python files or it was not an editor, therefore this function did not open the .py file in an editor.

In recent Slicer Preview Releases, a new option is added in menu: Edit / Application Settings / Python / General: `Editor for .py files`.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/a/8ac42ae68871e923fbe5b1f6f09b4278494c716e.png)

If path to an editor executable (such as Visual Studio Code, PyCharm, …) is specified there then Slicer will open .py files are opened using this program instead of the operating system default.

---

<div class="post-metadata">

**Author:** ![Muhammed\_Fatih\_Talu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muhammed_fatih_talu/32/14646_2.png) [@Muhammed\_Fatih\_Talu](https://discourse.slicer.org/u/Muhammed_Fatih_Talu)\
**Post date:** [July 12, 2023, 7:15pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/2 "2023-07-12T19:15:00Z")

</div>

Thanks for quick reply.  
But I dont see the “Editor for .py files:” parameter at Python-\>General.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/2/d23ba49c18425ba3a8a0c549a0e7fb062b0e9b67.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 12, 2023, 7:20pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/3 "2023-07-12T19:20:21Z")

</div>

> [@Muhammed\_Fatih\_Talu](#):
>
> But I dont see the “Editor for .py files:” parameter at Python-\>General.

As I wrote above, the feature was introduced in recent Slicer Preview Releases. Download the Slicer Preview Release to get this option.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 12, 2023, 7:25pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/4 "2023-07-12T19:25:23Z")

</div>

A post was split to a new topic: [SurfaceWrapSolidify extension does not work in latest Slicer Preview Release](https://discourse.slicer.org/t/surfacewrapsolidify-extension-does-not-work-in-latest-slicer-preview-release/30565)

---

<div class="post-metadata">

**Author:** ![moraleda](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/moraleda/32/77356_2.png) [@moraleda](https://discourse.slicer.org/u/moraleda)\
**Post date:** [October 10, 2023, 8:10pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/5 "2023-10-10T20:10:40Z")

</div>

Thanks for that. On Linux with Slicer 5.4, I can use Sublime as my editor. Sadly, on macOS with preview Slicer 5.5 this does not work. Am I doing something wrong? Should I put something different to the path? I am very new to macOS so there might be a mistake on my side. Thanks for your help.

 ![Screenshot 2023-10-10 at 22.05.52](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/5/f520ecdf500c4743c43c0de078af21cbb571afd5.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/b/cb99e621a0d8ca6abf702ba3514ea383bf1cb576.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 10, 2023, 8:24pm UTC](https://discourse.slicer.org/t/editor-for-py-files-is-now-configurable/30563/6 "2023-10-10T20:24:35Z")

</div>

You need to specify the executable there. “For your convenience” macOS Finder hides the actual executable file path and just returns the path of the app bundle. You need to open the bundle (by right-clicking on it and choose to open contents), then locate the executable file, and then copy that path to the Slicer settings.

My impression is that macOS user experience designers are obsessed with trying to make things simpler for the crowds and they don’t care if that makes things really inconvenient for developers like you.
