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

raashid baig indianboyfriend at hotmail.com
Tue May 30 03:38:43 EDT 2006


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