GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SethDamiani/PythonGraphics: Simple, object-oriented graphics library in Python.

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
images
images
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
graphics.py
graphics.py
 
 

Repository files navigation

PythonGraphics

The library 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).

This version was modified by me to add useful features. A complete list of changes made from the original is below. Some parts of this README and the wiki in this repository are taken from here and added to/edited by me.

Installation

To install this library, put graphics.py where it can be imported by python. It should work on any platform where Tkinter is available. It works with Python 2 and 3.

Getting Started

Extensive documentation is available in the wiki. Here is a complete program to draw a circle of radius 10 centered in a 100x100 window:

from graphics import *

def main():
	win = GraphWin("My Circle", 100, 100)  # Create a new Graphics Window with a title of "My Circle" and dimensions of 100px by 100px
	c = Circle(Point(50, 50), 10)  # Create a Circle object with a center point at (50, 50) and a radius of 10
	c.draw(win)  # Draw the circle in our window
	win.getMouse()  # Pause program for click in window
	win.close()  # Close the window at the end of the program

main()

Example

TODOs

  • Add ability to determine if a Point is located inside a GraphicsObject
    • Rectangle
    • Circle
    • Line
    • Polygon
    • Text
    • Entry
    • Image
  • Add ability to check where mouse cursor is
  • Add ability to detect right clicks as well as left clicks
  • Add chainable methods
  • Add keyword arguments to GraphicsObjects
  • Add ability to rotate GraphicsObjects
  • Add ability to resize GraphicsObjects

About

Simple, object-oriented graphics library in Python.

Topics

graphicsgraphics-librarygraphics-programminggraphics-renderinggraphics2dlibrarypythonpython-2python-3python-librarypython2python3tcltktkinter

Resources

Readme
GPL-3.0 license
Activity

Stars

6 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.