Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root = Tk()
- root.title("Application")
- canvas1 = Canvas(root, width = 200, height = 150)
- canvas1.pack()
- blackline = canvas1.create_line(0, 0, 200, 50) #-x, -y, x, y
- redline = canvas1.create_line(0, 100, 200, 50, fill = "red") #fill sets line to red.
- green_rectangle = canvas1.create_rectangle(20, 35, 120, 60, fill = "green")
- canvas1.delete(redline) #delete all: canvas1.delete(ALL)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement