[vtkusers] Resource forking problems on Mac with python and vtk
abair at viz.tamu.edu
Fri Dec 14 14:10:02 EST 2007
On Dec 14, 2007, at 8:51 AM, Sean McBride wrote:
> I'm sorry I can't help more... I've never used Python. Which
> runs Python scripts? Have you used other Python scripts that
> display a
> window and successfully allow interaction?
The executable is 'python' and is generally found in /usr/bin/
And I have successfully used the module 'Tkinter' (stands for Tk
interface). The following script opens a window that opens and closes
fine and registers keys and clicks (Obviously it doesn't use
# File: MouseKeyClicks.py
from Tkinter import *# load Tkinter module
root = Tk() # root widget is the window
# define mouse and key callbacks
print "clicked mouse"
print "pressed key"
# make window
frame = Frame(root, width=300, height=300)
# bind callbacks to keys and left mouse click
frame.pack() # size window and make it visible
frame.focus_set() # set focus to the frame so events will be
root.mainloop() # enter event loop
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers