1. Download the latest graphics.py from
HERE
.
2. Download graphics.py V5 documentation from
HERE
.
(pdf)
3. Copy graphics.py to the same directory as your Python programs.
Note: You may need to convert the file by using the DOS2UNIX program.
Graphics.py is a simple object oriented graphics library. It is designed to make it very easy for novice programmers to experiment with computer graphics in an object oriented fashion. It is written by John Zelle for use with the book "Python Programming: An Introduction to Computer Science" (Franklin, Beedle & Associates).
The package is a wrapper around Tkinter and should run on any platform where Tkinter is available.
There are two kinds of objects in the library. The GraphWin class implements a window where drawing can be done and various GraphicsObjects are provided that can be drawn into a GraphWin.
Graphics.py V5 is an open-source software released under the terms of the GPL (http://www.gnu.org/licenses/gpl.html).
Here is a simple example. It is a complete program to draw a circle of radius 10 centered in a 100x100 window:
Display the graphic.py version
How would you create a button? You would want to click on it and have some action performed. See the following code for a hint.
(YouTube)
graphics.py example program (python)
Python Graphics Programming (Graphics.py 1): The Basics
Python Graphics Programming (Graphics.py 2): Primitive shapes
Python Graphics Programming (Graphics.py 3): Images and text
Python Graphics Programming (Graphics.py 4): Text boxes