Contents

  1. graphics_test.py
  2. rectangle.py

graphics_test.py 1/2

[
top][prev][next]
# Graphics Test Script
# by Sara Sprenkle

from graphics import *

win = GraphWin("My Circle", 100, 100)
point = Point(50,50)
c = Circle(point, 10)
c.draw(win)

c.setOutline(color_rgb(100, 0, 0))

# demonstrate what happens, outside of IDLE, if the line below is commented out.
win.getMouse()

rectangle.py 2/2

[
top][prev][next]
# Draw a rectangle using the graphics API
# by CSCI111

from graphics import *

win = GraphWin("My Rectangle", 200, 200)


upperLeftPoint = Point(0, 100)
lowerRightPoint = Point(100, 0)

r = Rectangle(upperLeftPoint, lowerRightPoint)

# r = Rectangle(Point(0,100), Point(100,0))

r.draw(win)

win.getMouse()

Generated by GNU Enscript 1.6.6.