Advertisement
here2share

# Tkinter_create_circle_func.py

Jun 7th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # Tkinter_create_circle_func.py
  2.  
  3. from Tkinter import *
  4.  
  5. canvas_width = 180
  6. canvas_height =120
  7.  
  8. master = Tk()
  9.  
  10. w = Canvas(master,
  11.            width=canvas_width,
  12.            height=canvas_height)
  13. w.pack()
  14.  
  15. def circle(x,y, r):
  16.    id = w.create_oval(x-r,y-r,x+r,y+r)
  17.    return id
  18.  
  19. circle(canvas_width/2,canvas_height/2,30)
  20. circle(canvas_width/2,canvas_height/2,50)
  21.  
  22. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement