I can't seem to use pyGTK in any of the things I'm trying to program (I'm trying to set it up so I can use it for later), and I can't understand why. I've downloaded and installed all the dependencies here: http://www.pygtk.org/downloads.html and I've copied and pasted the code sample of
PHP Code:
import gtk
def createWindow():
window = gtk.Window()
window.set_default_size(200, 200)
window.connect('destroy', gtk.main_quit)
label = gtk.Label('Hello World')
window.add(label)
label.show()
window.show()
createWindow()
gtk.main()
from the PyGTK page of Wikipedia. But whenever I try to run it, I get this error:
Code:
Traceback (most recent call last):
File "gtk.py", line 2, in <module>
import gtk
File "/home/colin/gtk.py", line 15, in <module>
createWindow()
File "/home/colin/gtk.py", line 5, in createWindow
window = gtk.Window()
AttributeError: 'module' object has no attribute 'Window'
What do I have to do to get it run?
Bookmarks