Advertisement
TechnologyIsNotDull

Python test

Mar 21st, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. # This code requires Python 3 and tkinter (which is usually installed by default)
  2. # This code will NOT work on trinket.io as the tkinter module is not supported
  3. # TechnologyIsNotDull 2018
  4. # Not going to win the Turner Prize!
  5.  
  6. from shapes import Triangle, Rectangle, Oval
  7.  
  8. rect1=Rectangle()
  9. rect1.set_width(200)
  10. rect1.set_height(100)
  11. rect1.set_color("blue")
  12.  
  13. rect1.draw()
  14.  
  15. rect2=Rectangle()
  16. rect2.set_width(50)
  17. rect2.set_height(150)
  18. rect2.set_color("yellow")
  19.  
  20. rect2.set_x(100)
  21. rect2.set_y(100)
  22. rect2.draw()
  23.  
  24. tri=Triangle(5,200,100,200,100,400,'red')
  25. tri.draw()
  26.  
  27. rectx=Rectangle(40,40,200,200,'green')
  28. rectx.draw()
  29.  
  30. ov1=Oval(50,100,450,150,'purple')
  31. ov1.draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement