# Select only file extensions with ctkPathLineEdit

**URL:** <https://discourse.slicer.org/t/select-only-file-extensions-with-ctkpathlineedit/21642>\
**Category:** Development\
**Tags:** python\
**Created:** [January 26, 2022, 7:34pm UTC](https://discourse.slicer.org/t/select-only-file-extensions-with-ctkpathlineedit/21642 "2022-01-26T19:34:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kleingeo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kleingeo/32/6772_2.png) [@kleingeo](https://discourse.slicer.org/u/kleingeo)\
**Post date:** [January 26, 2022, 7:34pm UTC](https://discourse.slicer.org/t/select-only-file-extensions-with-ctkpathlineedit/21642/1 "2022-01-26T19:34:13Z")

</div>

I’m writing a module where I need to load a csv file. I am currently using `ctkPathLineEdit` to open a file selection dialog box. Is there a way to modify `ctkPathLineEdit` to only accept files with specific file extensions?

---

<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 27, 2022, 3:08am UTC](https://discourse.slicer.org/t/select-only-file-extensions-with-ctkpathlineedit/21642/2 "2022-01-27T03:08:19Z")

</div>

You can specify name filters in the `nameFilters` property of the `ctkPathLineEdit` widget:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/e/ee329e8b94deb50fec328a62f1ba2fc4c2ef1a20.png)

---

<div class="post-metadata">

**Author:** ![kleingeo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kleingeo/32/6772_2.png) [@kleingeo](https://discourse.slicer.org/u/kleingeo)\
**Post date:** [January 27, 2022, 3:25am UTC](https://discourse.slicer.org/t/select-only-file-extensions-with-ctkpathlineedit/21642/3 "2022-01-27T03:25:56Z")

</div>

> [@lassoan](#):
>
> `ctkPathLineEdit`

Thannks, this was all I needed.

```python
self.dataframePath = ctk.ctkPathLineEdit()
self.dataframePath.settingKey = 'measurementFile'
self.dataframePath.filters = ctk.ctkPathLineEdit.Files
self.dataframePath.nameFilters = ['*.csv']

```
