# How to hide the code of the script module?

**URL:** <https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135>\
**Category:** Development\
**Tags:** python, scripted\
**Created:** [November 8, 2022, 1:20pm UTC](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135 "2022-11-08T13:20:00Z")\
**Posts on this page:** 1\
**Showing post:** 13

<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:** [January 23, 2024, 9:31pm UTC](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135/13 "2024-01-23T21:31:56Z")

</div>

> [@MJamal](#):
>
> Could you please guide me to the file(s) where this happens?

You can search for “.pyc” in the slice source tree.

> [@MJamal](#):
>
> It seems like I don’t have many choices but .pyc. Anyways, instead of manually distributing the .pyc files, how can i automate this in the Slicer build process to generate and utilize .pyc files in the qt-scripted-module directory and completely eliminate the .py files?

The simplest is probably to write a short Python script that compiles your .py files and then replaces the .py files by the .pyc files.

This script could added as a custom build or installation step in your extension build CMake files. If you are not sure how to do it, you can ask advice on the CMake forum or contract a CMake expert at Kitware.

---

_[View the full topic](https://discourse.slicer.org/t/how-to-hide-the-code-of-the-script-module/26135)._
