# 3d slicer custom app: how to obfuscate python code

**URL:** <https://discourse.slicer.org/t/3d-slicer-custom-app-how-to-obfuscate-python-code/35006>\
**Category:** Development\
**Created:** [March 21, 2024, 1:23pm UTC](https://discourse.slicer.org/t/3d-slicer-custom-app-how-to-obfuscate-python-code/35006 "2024-03-21T13:23:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aymeric.chataigner](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aymeric.chataigner/32/4977_2.png) [@aymeric.chataigner](https://discourse.slicer.org/u/aymeric.chataigner)\
**Post date:** [March 21, 2024, 1:23pm UTC](https://discourse.slicer.org/t/3d-slicer-custom-app-how-to-obfuscate-python-code/35006/1 "2024-03-21T13:23:29Z")

</div>

Hi,

We would like to obfuscate the python code in the install archive of our 3D Slicer custom app.  
We tried to use cython without success for now.  
Do you have any solution, any advice ?

Regards

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 21, 2024, 1:56pm UTC](https://discourse.slicer.org/t/3d-slicer-custom-app-how-to-obfuscate-python-code/35006/2 "2024-03-21T13:56:28Z")

</div>

I suggest looking at this thread

> [@How to hide the code of the script module?](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135/26):
>
> Corresponding approach was revisited by instead introduce the option CTK\_COMPILE\_PYTHON\_SCRIPT\_KEEP\_ONLY\_PYC to support removing \*.py script once the corresponding \*.pyc file has been generated in the destination directory. See [https://github.com/commontk/CTK/pull/1192](https://github.com/commontk/CTK/pull/1192)@MJamal At your convenience, consider reviewing and testing the proposed changes pray
