$ sudo apt-get install libgtk-3-dev
(referene: Install GTK+ 3.0 on Raspberry Pi)
Once installed, Python 2 (python and IDLE) can work use GTK+ 3.0 library to programming with GUI.
Dummy example of Python program with GTK+ 3.0
#!/usr/bin/python
from gi.repository import Gtk
win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
"Hello World" of Python 2.7.3 with GTK+ 3 |
$ sudo apt-get install python3-gi
ImportError: No module named gi.repository |
"Hello World" of Python 3.2.3 with GTK+ 3 |
The Python GTK+ 3 Tutorial gives an introduction to writing GTK+ 3 applications in Python.
No comments:
Post a Comment