[Paraview] location of python plugin macro

m.c.wilkins at massey.ac.nz m.c.wilkins at massey.ac.nz
Wed Jun 9 17:15:02 EDT 2010


Hi,

I would like to find the location of the currently running python
plugin macro.  This is so I can do an import of a library that lives
in a directory relative to the directory where all my paraview plugins
live.  Is this possible?

In a normal python programme sys.argv[0] can help me, but ofcourse
that just points to the paraview binary in this case.  os.getcwd() is
no use.  The info is known to paraview (for instance it is in
~/.config/ParaView/ParaView3.8.0.ini file under the [PythonMacros]
section - but I really don't want to go trolling through that file).

I have quite a few plugins, and I want to do the correct thing by
breaking some of the shared functionality out into a module.

Thanks for any help

Matt



More information about the ParaView mailing list