[vtk-developers] VTK/Python and Sun new discoveries

Andy Cedilnik andy.cedilnik at kitware.com
Fri May 24 08:57:57 EDT 2002


Hello!

So, my previous attempt to include C++ libraries to vtk kits failed when
trying to use tk widget. The solution I found was to actually build
python using C++ compiler. Now, this is not as bad as it seems. I am
thinking we should provide vtkPython binary as we provide vtkTcl binary.
It is actually an extremely simple code:

vtkPython.cxx:

/* Minimal main program -- everything is loaded from the library */

#include "Python.h"
#include <iostream.h>
extern "C" { int Py_Main(int, char**); }

int
main(int argc, char **argv)
{
  return Py_Main(argc, argv);
}

This will make sure C++ classes are properly initialized. Later we can
do even more, by setting the load path and so on. 
I tested this with a tk render widget cone code and it works fine.

Note to python developers:
Please add some tests to vtk that will use tk render widget.

Comments?

			Andy




More information about the vtk-developers mailing list