# Get the filename in the python programmable filter.

**URL:** https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188
**Category:** ParaView Support
**Created:** [May 9, 2021, 10:46pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188 "2021-05-09T22:46:28Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 9, 2021, 10:46pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/1 "2021-05-09T22:46:28Z")

</div>

Hi Mathieu, I have a quite similar question, but I would like to get the filename in the python programmable filter. Over there, what’s the similar function as GetActiveSource().FileName? Thanks very much for your help.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 10, 2021, 6:26am UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/2 "2021-05-10T06:26:02Z")

</div>

Not supported by ParaView.

---

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 10, 2021, 9:35am UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/3 "2021-05-10T09:35:45Z")

</div>

Thanks a lot for your quick reply. I’m wondering if I want to create a button in GUI to get the filename, what do you think is probably the best way of doing this? Thank you ! 🙂

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 10, 2021, 9:40am UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/4 "2021-05-10T09:40:06Z")

</div>

> [@Pauly1](#):
>
> to get the filename,

To get it where and to do what ? The filename is visible in the information panel.

---

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 10, 2021, 12:05pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/5 "2021-05-10T12:05:01Z")

</div>

Hi Mathieu, I have a 3D CFD python code, I would like to integrate it into Paraview (have a GUI to read/visual initial mesh) then use run my python code (my code need this initial mesh filename to work on), after that visualize the result. The easiest way I can think of is using programmable filter, that’s why I’m asking this question. If there is any better way of doing this, that’s will be great. Thank you.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 10, 2021, 12:07pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/6 "2021-05-10T12:07:29Z")

</div>

So you want to read the mesh using your own python code ? A python programmable source is indeed the way to prototype this, and in the end you should use a python plugins to expose a reader for your format.

---

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 10, 2021, 12:13pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/7 "2021-05-10T12:13:28Z")

</div>

I didn’t explain it very well I guess. No, I use common mesh file as input, Paraview can already handle them, I don’t want to rewrite it. But I would like to add some GUI component on paraivew, so that the user can directly select input mesh file, then run my CFD code on paraview (maybe programmable source, or programmable filter…) The objective is making users can do everything on Paraview, including flow simulation which actually run by my solver.

Or to simplify it further, at the moment I use paraview to visualize all mesh, and simulation results, but use my python code to run the simulation, can I develop a GUI in paraview to integrate them all together, so the user can do everhing on Paraview by clicking buttons 🙂

Thank you very much Mathieu!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 10, 2021, 12:18pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/8 "2021-05-10T12:18:25Z")

</div>

Yes, definitelly possible, but the ProgrammableFilter will not have access to the filename.

---

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 10, 2021, 12:20pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/9 "2021-05-10T12:20:02Z")

</div>

Thanks! Then what’s the best way of doing this? Is it possible to implement everything using Python without compiling paraview? (My main language also avoid compiling the Paraview myself)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 10, 2021, 1:06pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/10 "2021-05-10T13:06:22Z")

</div>

Yes ! See this topic:

> [@Help on a python programmable filter plugin](https://discourse.paraview.org/t/help-on-a-python-programmable-filter-plugin/2104/4):
>
> sure thing…I’ll update the example and get back to you.

---

<div class="post-metadata">

### Author: ![Pauly1](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a8b319/32.png) [@Pauly1](https://discourse.paraview.org/u/Pauly1)
#### Post date: [May 10, 2021, 9:43pm UTC](https://discourse.paraview.org/t/get-the-filename-in-the-python-programmable-filter/7188/11 "2021-05-10T21:43:34Z")

</div>

👍 Thanks Mathieu, it’s very helpful!
