This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using PyGTK on Cygwin


Hi everyone.
I'm a very newbie with Python: while I was looking for a way to add a simple GUI to a bash script, I found PyGTK and it looked perfect for my aim.
So, I checked that Python and PyGTK were installed and updated through Cygwin setup, and everything was fine.
I wrote this simple "hello world" script and tried to run:


---
import gtk

#Global variable 'count' stores the number of button clicks
count = 0

def button_pressed_cb(button):
    global count
    count += 1
    print "Hello again - the button was pressed: ", count, " time(s)."

window = gtk.Window()
window.set_title("Hello World!")

button = gtk.Button("Press me")
button.connect("clicked", button_pressed_cb)

window.add(button)
window.connect("delete-event", gtk.main_quit)
window.show_all()

gtk.main()
---

It stops on the first line:

Traceback (most recent call last):
  File "prova.py", line 1, in <module>
    import gtk
ImportError: No module named gtk



Can please anyone help me?

Thank you,
Ignazio


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]