# How to make modification of Home module work in Custom Application?

**URL:** <https://discourse.slicer.org/t/how-to-make-modification-of-home-module-work-in-custom-application/24969>\
**Category:** Development\
**Created:** [August 29, 2022, 5:53am UTC](https://discourse.slicer.org/t/how-to-make-modification-of-home-module-work-in-custom-application/24969 "2022-08-29T05:53:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnzzll](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nnzzll/32/16350_2.png) [@nnzzll](https://discourse.slicer.org/u/nnzzll)\
**Post date:** [August 29, 2022, 5:53am UTC](https://discourse.slicer.org/t/how-to-make-modification-of-home-module-work-in-custom-application/24969/1 "2022-08-29T05:53:00Z")

</div>

I’m developing a custom application of Slicer and successfully build the project.  
The application is switched to the “Home” module by default and I’d like to make some modification in the “Home” module.  
However, whatever change I had made in the `Home.py` file it just doesn’t work.  
For example , I added a simple line

```auto
print("HomeWidget init!")

```

to the ` __init__ ` method of `HomeWidget` and rebuild this project. When the program starts up this function just won’t be called.

How to solve this problem?

---

<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:** [September 2, 2022, 9:51am UTC](https://discourse.slicer.org/t/how-to-make-modification-of-home-module-work-in-custom-application/24969/2 "2022-09-02T09:51:51Z")

</div>

A very basic suggestion, but may be the case if I understand your problem correctly. You may be trying to change the source code and expect that the change to be reflected in the build. If so, you may need to do either of the following

1. Run the build
2. Edit the deployed source files in `[SuperbuildPath]/Slicer-build/lib/[AppName]-5.0/qt-scripted-modules`. But then remember to copy those back to source otherwise you’ll lose the changes when you run a build
3. Edit the source code in the working copy and have a script copy the `.py` files to the binary folder (see just above). This is what I do when I only edit Python files

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [September 2, 2022, 2:24pm UTC](https://discourse.slicer.org/t/how-to-make-modification-of-home-module-work-in-custom-application/24969/3 "2022-09-02T14:24:34Z")

</div>

> [@cpinter](#):
>
> Run the build

An additional method/option for ‘run the build’: you can use cmake/ninja/make/etc to run just the targets that copy over the .py files, ex:

```auto
cd /path/to/Slicer-build
cmake --build . --target CopySlicerPythonScriptFiles
cmake --build . --target CopySlicerPythonResourceFiles

```
