[vtkusers] How to build VTK in python while working with Windows XP

Sven Prevrhal sven.prevrhal at radiology.ucsf.edu
Tue May 30 12:37:53 EDT 2006


Hi Raashed,
See http://www.vtk.org/get-software.php : For Python support, you will have
to compile the software. I am using Python 2.4 with vtk 5 and up on Windows
XP just fine.

- Sven


-----Original Message-----
From: raashid baig [mailto:indianboyfriend at hotmail.com] 
Sent: Tuesday, May 30, 2006 12:39 AM
To: vtkusers at vtk.org
Subject: [vtkusers] How to build VTK in python while working with Windows XP

Hi,
I am very new to Python and VTK and I am using them on a machine running on
Windows XP. Somebody please help me by telling how to install VTK so that it
could be used in Python with IDLE as an editor.

I have downloaded the 	vtk-5.0.0-win32.exe and installed it in the default
directory C:\Program File\VTK 5.0 but how to use the while importing modules
in Python does'nt click to me.

I even tried the   enthon-python2.3-0.9.6.exe but it too was unable to
import modules from the vtk dirctory when I used the following code in IDLE:

from Tkinter import *
from VTK import *

# Make a root window
root = Tk() 

# Add a vtkTkRenderWidget
renderWidget = vtkTkRenderWidget(root,width=400,height=400)
renderWidget.pack(expand='true',fill='both')

# Get the render window from the widget
renWin = renderWidget.GetRenderWindow()

# Next, do the VTK stuff
ren = vtkRenderer()
renWin.AddRenderer(ren)
cone = vtkConeSource()
cone.SetResolution(16)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)

# Make a quit button
def quit():
    root.destroy()

button = Button(text="Quit",command=quit)
button.pack(expand='true',fill='x')

# start up the event loop
root.mainloop()


Please somebody help me with the above problem so that I could start learing
VTK.

Raashid Baig
_________________________________________________________________
Enter the Windows Live Mail beta sweepstakes
http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx





More information about the vtkusers mailing list