# Get the path for a scripted module

**URL:** <https://discourse.slicer.org/t/get-the-path-for-a-scripted-module/10933>\
**Category:** Development\
**Created:** [March 31, 2020, 8:16am UTC](https://discourse.slicer.org/t/get-the-path-for-a-scripted-module/10933 "2020-03-31T08:16:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZiyunLiang](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@ZiyunLiang](https://discourse.slicer.org/u/ZiyunLiang)\
**Post date:** [March 31, 2020, 8:16am UTC](https://discourse.slicer.org/t/get-the-path-for-a-scripted-module/10933/1 "2020-03-31T08:16:08Z")

</div>

Hi all,  
I load a scripted module to Slier by adding the module path to ‘Edit / Application settings’.  
I want to access the path of this module in my .py file because I want to load other files to Slicer in that path without stating again. Does anyone know how to get the path of my already loaded module in python console?  
Thanks!

---

<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 31, 2020, 3:25pm UTC](https://discourse.slicer.org/t/get-the-path-for-a-scripted-module/10933/2 "2020-03-31T15:25:31Z")

</div>

You can use `scriptPath = os.path.dirname(os.path.abspath( __file__ ))` anywhere in the file. In the widget class, there is a convenience method to get full path to a resource file: `self.resourcePath('UI/mycustomfile.txt')`.

To add these additional files to the extension’s installation package, you need to store the files in the module’s `Resources` subfolder and add the files to `MODULE_PYTHON_RESOURCES` list in `CMakeLists.txt`.
