[Paraview] Python shell, os.environ

Heiland, Randy heiland at iu.edu
Wed Dec 20 17:50:50 EST 2017


Ah, I see ‘os’ has been hijacked by PV. But something like this seems to accomplish what I want, maybe…

Create a new module for PV:

/Applications/ParaView-5.4.1.app/Contents/Python$ more envs.py
import os
os.environ['PHYSICELL_DATA']=‘/fill_in_path’

and then in the PV Python shell, the os.environ will indeed contain this new env var.


> On Dec 20, 2017, at 4:30 PM, Heiland, Randy <heiland at iu.edu> wrote:
> 
> I noticed the Python shell has a very limited os.environ, e.g.:
>>>> os.environ
> {'SHELL': '/bin/bash', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.y86uYmHWFV/Listeners', 'XPC_FLAGS': '0x0', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'Apple_PubSub_Socket_Render': '/private/tmp/com.apple.launchd.CM4C6EMoE6/Render', 'LOGNAME': 'heiland', 'USER': 'heiland', 'XPC_SERVICE_NAME': 'org.paraview.ParaView.33336', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/Users/heiland', 'DISPLAY': '/private/tmp/com.apple.launchd.4ORv1l0yeN/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/l6/s467rzgs75n91gdbkn7vr0f40000gn/T/'}
>>>> 
> 
> I’m guessing this is a security measure? Anyway, is there any way one can use an env var to pass in desirable info to PV’s Python, e.g., a dir path to data to be read by a Programmable Source? Or perhaps there’s some other entirely different way to do this?
> 
> thanks, Randy
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
> 
> Search the list archives at: http://markmail.org/search/?q=ParaView
> 
> Follow this link to subscribe/unsubscribe:
> https://paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list