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

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Tue Oct 2 06:12:42 EDT 2001


hi,

I was checking out the Python installer
(http://www.mcmillan-inc.com/install1.html) and had trouble with
getting VTK going with it properly.  I was looking at the code in
Wrapping/Python/*.py and have the following comments.

vtkpython.py
^^^^^^^^^^^^^

The code in vtkpython.py, though short relies on "exec hacks".  Could
we modify this to be done with explicit import statements?  Earlier
with vtk3.2 the vtkpython.c used to generate vtkpython.so and would do
this.

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?

Making this code smaller doesn't give us much since, it is unlikely to
change much over time.  Using a longer version makes it easier to use
the installer for python/vtk programs.  What do you think?


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?

thanks,
prabhu

-- 
Those who hate and fight must stop themselves -- otherwise it is not
stopped.
		-- Spock, "Day of the Dove", stardate unknown



More information about the vtk-developers mailing list