# Feature Flags for custom Python slicer extensions

**URL:** <https://discourse.slicer.org/t/feature-flags-for-custom-python-slicer-extensions/22502>\
**Category:** Development\
**Created:** [March 14, 2022, 4:20pm UTC](https://discourse.slicer.org/t/feature-flags-for-custom-python-slicer-extensions/22502 "2022-03-14T16:20:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srijeet\_Chatterjee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/srijeet_chatterjee/32/12027_2.png) [@Srijeet\_Chatterjee](https://discourse.slicer.org/u/Srijeet_Chatterjee)\
**Post date:** [March 14, 2022, 4:20pm UTC](https://discourse.slicer.org/t/feature-flags-for-custom-python-slicer-extensions/22502/1 "2022-03-14T16:20:05Z")

</div>

Hello everyone,

I want to develop a feature flag (possibly in a config file) such that it helps to enable/disable several functionalities of the extension(shows/hides a tab completely from the user). Can anyone please help me with possible ideas to implement this or best approaches to handle this problem.

Would the launcher.ini file be a good starting point? Is there a way I can add a key, or there is something even simplier already existing.

Thanks and Best regards,  
Srijeet

---

<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:** [March 14, 2022, 4:36pm UTC](https://discourse.slicer.org/t/feature-flags-for-custom-python-slicer-extensions/22502/2 "2022-03-14T16:36:30Z")

</div>

You can store application settings persistently in the [`Slicer.ini` file](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#settings-file-location) via the `slicer.app.userSettings()` object. See [QSettings documentation](https://doc.qt.io/qt-5/qsettings.html) for API description and [Slicer scripted modules](https://github.com/Slicer/Slicer/tree/master/Modules/Scripted) for usage examples.

---

<div class="post-metadata">

**Author:** ![Srijeet\_Chatterjee](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/srijeet_chatterjee/32/12027_2.png) [@Srijeet\_Chatterjee](https://discourse.slicer.org/u/Srijeet_Chatterjee)\
**Post date:** [March 28, 2022, 9:22am UTC](https://discourse.slicer.org/t/feature-flags-for-custom-python-slicer-extensions/22502/3 "2022-03-28T09:22:18Z")

</div>

Thanks a lot, could set the flags via the .ini files and the slicer.app documentation helped along with [configparser — Configuration file parser — Python 3.10.4 documentation](https://docs.python.org/3/library/configparser.html)
