Page 208 - Programming With Python 3
P. 208
An Introduction to STEM Programming with Python — 2019-09-03a Page 195
Chapter 19 — Better Graphics
Free
eBook
Edition
1| import graphics
2| import time
3|
4| def main():
5|
6| speed = .05
Please support this work at
7|
8| window = graphics.GraphWin()
9| face = graphics.Circle(graphics.Point(100,100),100)
http://syw2l.org
10| face.setFill("yellow")
11| face.draw(window)
12| mouth = graphics.Oval(graphics.Point(50,130),
graphics.Point(150,170))
13| mouth.setFill("red")
14| mouth.draw(window) Free
15| lip =
graphics.Rectangle(graphics.Point(50,130),graphics.Point(150,
150))
16| lip.setFill("yellow")
17| lip.setWidth(0)
18| lip.draw(window) eBook
19| reye = graphics.Circle(graphics.Point(50,75),25)
20| reye.setFill("white")
21| reye.setWidth(2)
22| reye.draw(window)
23| leye = graphics.Circle(graphics.Point(150,75),25)
24| leye.setFill("white") Edition
25| leye.setWidth(2)
26| leye.draw(window)
Copyright 2019 — James M. Reneau Ph.D. — http://www.syw2l.org — This work is licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License.

