CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] Transfer variables into python script from bash-shell (https://www.cfd-online.com/Forums/paraview/163650-transfer-variables-into-python-script-bash-shell.html)

cfdFreshman December 3, 2015 03:33

Transfer variables into python script from bash-shell
 
Hello to all,

today my issue is the integration of variables in python script.
I would like to transfer a few variables from bash to a python script witch is traced with ParaView 4.4.0. In a former version of ParaView (3.89) I've had the following commands:

in bash (.sh):
pathTo/pvbatch --use-offscreen-rendering pathTo/pythonScript.py $variable1 constant $variable2 ...

in python script (.py):
import sys
try: paraview.simple
except: from paraview.simple import *

nameVariable1 = sys.argv [1]
nameConstant = sys.argv [2]
nameVariable2 = sys.argv [3]
...

But if I use these in .py version 4.4.0 it shows an error concerning "argv".
Do you know what I have missed or how I can do it in a different way?

Thanx!

Regards,
cfdFreshman


All times are GMT -4. The time now is 19:57.