Tutorial for beginners (Python) Un tutoriel pour les débutants souhaitant apprendre comment programmer des interfaces utilisateur graphiques en Python. Tiffany Antopolski tiffany.antopolski@gmail.com 2012 Marta Maria Casetti mmcasetti@gmail.com 2012 2013 Jim Campbell jwcampbell@gmail.com 2013 Luc Rebert, traduc@rebert.name 2011 Alain Lojewski, allomervan@gmail.com 2011-2012 Luc Pionchon pionchon.luc@gmail.com 2011 Bruno Brouard annoa.b@gmail.com 2011-12 Luis Menina liberforce@freeside.fr 2014 Tutorial for beginners

By following these tutorials you will learn the basics of GUI programming using GTK+ in Python.

Si vous n'avez jamais programmé auparavant, ou si vous n'êtes pas à l'aise avec le concept de programmation orienté objets, il est préférable d'acquérir quelques bases avant toute chose. Vous pourriez par exemple commencer par lire les livres Learn Python the Hard Way ou The Python Tutorial. Vous pourriez aussi être intéressé par The Python GTK+ 3 Tutorial. Dès que vous maîtrisez les bases, n'oubliez pas de revenir consulter ces tutoriels.

Lancement des exemples de code

To run the code samples in the tutorial:

Type or copy and paste the code into a file, and save the file with a name like filename.py

To execute the code, type in the terminal:

python nomdufichier.py

After executing the code, you will either see the widget on your screen, or (if you have mistyped some of the code) you will see an error message that will help you identify the problem.

A path through the widgets (with some theory)

The tutorial will walk you through increasingly complex examples and programming theory, but you can also feel free to just go directly to the tutorial that is most helpful to you.

Tutoriel Fenêtres élémentaires

Images et étiquettes

Introduction to properties

Grid, separator and scrolling

Signals, callbacks and buttons

ButtonBox

Autre éléments graphiques d'affichage

Entry widgets

A widget to write and display text

Boîtes de dialogue

Menus, Toolbars and Tooltips (also: using Glade and GtkBuilder)

Sélecteurs

Arborescences et boites combinées (utilisant la conception M/V/C)

Élément graphique personnalisé