# python code from the pipeline

**URL:** https://discourse.paraview.org/t/python-code-from-the-pipeline/10426
**Category:** ParaView Support
**Tags:** python
**Created:** [September 28, 2022, 10:18pm UTC](https://discourse.paraview.org/t/python-code-from-the-pipeline/10426 "2022-09-28T22:18:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pravin\_Poudel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/pravin_poudel/32/9830_2.png) [@Pravin\_Poudel](https://discourse.paraview.org/u/Pravin_Poudel)
#### Post date: [September 28, 2022, 10:18pm UTC](https://discourse.paraview.org/t/python-code-from-the-pipeline/10426/1 "2022-09-28T22:18:15Z")

</div>

i am trying to get the segmented output of the mesh after generating contour tree of elevation.

I tried to get it from the python file generated from the paraview but it seems to have hardcoded value and in mose of the code has hardcoded value used for the specitifc input in the pipeline, it doesnot seems useful for generic case.

is there anyway i can generate that kind of code because it doesnot seems like i can change the code generated by paraview to fit the generic case because it’s so big and i dont understand what those parameter mean where a hard-coded value is passed !

or, anyone could please suggest a way to make it more generic?

my pipeline:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f94d0572b454fd5fc43870beca839fa672cacfcf.png)

and i want to output this scene as gltf:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/bf7f019ad2f3a7508f9f4d5304ea9dfcc2cd4c19.png)

This is the code that i got from the exporting python or trace.

> **[GDB online Debugger | Code, Compile, Run, Debug online C, C++](https://www.onlinegdb.com/q4z7Yo6fn)**
>
> Online GDB is online ide with compiler and debugger for C/C++. Code, Compiler, Run, Debug Share code nippets.

Can anyone please help me !!

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [September 29, 2022, 8:01am UTC](https://discourse.paraview.org/t/python-code-from-the-pipeline/10426/2 "2022-09-29T08:01:08Z")

</div>

Hi @Pravin_Poudel ,

This question does not seems very different than your previous [get paraview pipeline into python](https://discourse.paraview.org/t/get-paraview-pipeline-into-python/10419). It is not necessary to open new post so quickly after the first 😉

I added some information there.

---

<div class="post-metadata">

### Author: ![Pravin\_Poudel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/pravin_poudel/32/9830_2.png) [@Pravin\_Poudel](https://discourse.paraview.org/u/Pravin_Poudel)
#### Post date: [October 5, 2022, 12:45pm UTC](https://discourse.paraview.org/t/python-code-from-the-pipeline/10426/3 "2022-10-05T12:45:53Z")

</div>

i followed and tried the things stated in that article and still i am not able to do that.

> [@no module found: paraview error](https://discourse.paraview.org/t/no-module-found-paraview-error/10451):
>
> I followed the thread [Not able to import paraview.simple module on windows](https://discourse.paraview.org/t/not-able-to-import-paraview-simple-module-on-windows/537) still i am not able to run paraview and am getting not module found error: This is path in environment variable: and this is my pythonpath variable: and still when i run my code PS C:\work\paraview Projs\paraviewPY\> & C:/Users/pravin/AppData/Local/Programs/Python/Python39/python.exe "c:/work/paraview Projs/paraviewPY/main.py" Traceback (most recent call last): File "c:\work\paraview Projs\paravie…

is there anything that i am doing wrong or anything extra that i should do that you suggest.

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [October 5, 2022, 10:15pm UTC](https://discourse.paraview.org/t/python-code-from-the-pipeline/10426/4 "2022-10-05T22:15:01Z")

</div>

Why don’t you use pvpython to run your python code that use the ParaView library?
