[Paraview] Python shell, os.environ

Ben Boeckel ben.boeckel at kitware.com
Thu Dec 21 09:34:03 EST 2017


On Wed, Dec 20, 2017 at 22:50:50 +0000, Heiland, Randy wrote:
> 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.

This can't be part of the package though since if it is installed
globally, users may not have write access to the .app directory.

It seems the way to do this is along these lines (in short, Apple isn't
making what you want to do easy):

    https://superuser.com/questions/476752/setting-environment-variables-in-os-x-for-gui-applications#541068
    https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/32405815#32405815

There seems to have been something like `~/.launchd.conf` at some point
and `~/.MacOSX/environment.plist` before that, but those has been
deprecated and no longer work.

--Ben


More information about the ParaView mailing list