|
[Sponsors] |
[General] Close Paraview after python script execution |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 7, 2013, 12:51 |
Close Paraview after python script execution
|
#1 |
Member
William Tougeron
Join Date: Jan 2011
Location: Czech Republic
Posts: 70
Rep Power: 15 |
Hi all,
I would like to launch Paraview from a bash command so as to execute a script and then exit automatically at the end of the script. To launch Paraview and execute the script, I use: Code:
paraview --script=script_name.py Does anybody know how to make it close? Thank you very much for help! Best regards, William |
|
October 11, 2013, 19:20 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings William,
Why not use pvpython or pvbatch? Beyond this, you can try the instructions given here: http://stackoverflow.com/questions/9...python-program Best regards, Bruno
__________________
|
|
October 14, 2013, 09:19 |
|
#3 |
Member
William Tougeron
Join Date: Jan 2011
Location: Czech Republic
Posts: 70
Rep Power: 15 |
||
October 7, 2015, 11:23 |
|
#4 |
Senior Member
|
In case someone is reading on and, like me,
1) doesn't have the python-qt4 libraries compatible with his paraview binaries installed, and 2) obtains the desired rendering only using paraview --script and not by using pvpython or pvbatch, for some mysterious reason, a solution may also be to execute something like this within the python script: Code:
import subprocess subprocess.call("kill $(ps aux|grep -e 'paraview --script=./YOUR_SCRIPT_NAME.py'|grep -v grep|awk {'print $2'})", shell=True) |
|
August 29, 2019, 22:29 |
|
#5 |
New Member
Zak
Join Date: Aug 2019
Posts: 1
Rep Power: 0 |
Sorry to respond even later but this is what came up when I was searching this and I found an even simpler way!
Just import sys and then run sys.exit(0). This closes paraview for me, and the 0 is an OK exit code. |
|
Tags |
paraview 3.98 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Paraview from python shell : Glew initialization and VTKcommoncorepython error | pradyumnsingh | ParaView | 0 | September 18, 2018 14:40 |
[General] “Upload” vtk data from client to server in paraview script | Jack001 | ParaView | 0 | March 8, 2018 08:27 |
[General] How to write a script to get multiple slices with paraview? | kiddmax | ParaView | 19 | November 7, 2016 02:57 |
[OpenFOAM] Integrate Variables using ParaView Python Shell | cfdsolver1 | ParaView | 0 | October 12, 2016 04:08 |
[OpenFOAM] paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 | aylalisa | ParaView | 4 | June 13, 2014 09:52 |