DEV Community

Cover image for Simple Face
Scott Gordon
Scott Gordon

Posted on

Simple Face

This is a simple program to draw a simple face using the graphics module created by John Zelle.

# simple_face.py
#   Drawing of a simple face
# by: Scott Gordon

from graphics import *


def main():
    win = GraphWin("Face", 300, 300)
    win.setCoords(-3, -3, 3, 3)
    win.setBackground("white")
    center = Point(0, 0)

    head = Circle(center, 2)
    head.setFill("yellow")
    head.draw(win)

    eye = Circle(Point(-1, .50), .25)
    eye.setFill("black")
    eye.draw(win)

    eye2 = eye.clone()
    eye2.move(2,0)
    eye2.draw(win)

    mouth = Line(Point(-1, -.5), Point(1, -.5))
    mouth.setWidth(7)
    mouth.draw(win)

    win.getMouse()
    win.close()

main()

Enter fullscreen mode Exit fullscreen mode

Top comments (0)