[vtk-developers] New vtkpython.py - comments.

David Gobbi dgobbi at irus.rri.ca
Tue Oct 2 14:27:24 EDT 2001


On Tue, 2 Oct 2001, Prabhu Ramachandran wrote:

> The problem with using exec "from "+kit_name+" import *" is that the
> python installer will be unable to find the libraries since it cannot
> figure out what is being imported. Of course, using the exec makes the
> code small but maybe we should look and see if its the "right way" of
> doing things?

If the installer won't work unless everything is explicit, then go for
it.  You have to admit, though, the current vtkpython.py is very pretty
to look at ;)

One problem with the current vtkpython.py that would not be fixed by
making it 'explicit' is this:  if one of the 'optional' kits refuses to
load because of e.g. an unresolved run-time symbol then no error is
generated.


Actually, though, rather than modifying vtkpython.py right away,
I'd like to see Dan Blezek's idea of a module directory structure
implemented:  vtk.common, vtk.rendering, vtk.patented, etc. so
that people can explicitly state in their programs which kits
are desired.  This would also solve the installer problem.

> vtkLoadPythonTkWidgets.py
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> The vtkLoadPythonTkWidgets.py code also runs into trouble with the
> installer.  The code implicitly assumes that sys.path is a string -
> which it isnt when you use the installer.  This is easily modified by
> adding a simple try block.  Can I make this modification and commit
> it?

Do it.

 - David




More information about the vtk-developers mailing list