-
Notifications
You must be signed in to change notification settings - Fork 0
/
canvas.py
16 lines (15 loc) · 880 Bytes
/
canvas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# canvas = widget that is used to draw graphs, plots, images in a window
from tkinter import *
window = Tk()
canvas = Canvas(window, width=500, height=500)
# blueline = canvas.create_line(0, 0, 500, 500, fill="blue", width=5)
# redline = canvas.create_line(0, 500, 500, 0, fill="red", width=5)
# canvas.create_rectangle(50, 50, 250, 250, fill="purple")
# points = [250, 0, 500, 500, 0, 500, ]
# canvas.create_polygon(points, fill="yellow", outline="black", width=5)
# canvas.create_arc(0, 0, 500, 500, fill="green", style=PIESLICE, start=90, extent=180) # style=arc,PIESLICE<CHORD<
canvas.create_arc(0, 0, 500, 500, fill="red", extent=180, width=10 , outline="black")
canvas.create_arc(0, 0, 500, 500, fill="white", extent=180, start=180, width=10, outline="black")
canvas.create_oval(190, 190, 310, 310, fill="white", width=10, outline="black")
canvas.pack()
window.mainloop()