delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/06/10/05:48:39

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Ignazio Di Napoli <neclepsio AT gmail DOT com>
Subject: Using PyGTK on Cygwin
Date: Sun, 10 Jun 2007 11:48:01 +0200
Lines: 44
Message-ID: <f4ghcd$ut8$1@sea.gmane.org>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.0 (Windows/20070326)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019