Advertisement
Guest User

new

a guest
Oct 19th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from graphics import *
  2.  
  3. def main():
  4. win = GraphWin('Face', 200, 150) # give title and dimensions
  5. win.yUp() # make right side up coordinates!
  6.  
  7. head = Circle(Point(40,100), 25) # set center and radius
  8. head.setFill("yellow")
  9. head.draw(win)
  10.  
  11. eye1 = Circle(Point(30, 105), 5)
  12. eye1.setFill('blue')
  13. eye1.draw(win)
  14.  
  15. eye2 = Line(Point(45, 105), Point(55, 105)) # set endpoints
  16. eye2.setWidth(3)
  17. eye2.draw(win)
  18.  
  19. mouth = Oval(Point(30, 90), Point(50, 85)) # set corners of bounding box
  20. mouth.setFill("red")
  21. mouth.draw(win)
  22.  
  23. label = Text(Point(100, 120), 'A face')
  24. label.draw(win)
  25.  
  26. message = Text(Point(win.getWidth()/2, 20), 'Click anywhere to quit.')
  27. message.draw(win)
  28. win.getMouse()
  29. win.close()
  30.  
  31. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement