import tkinter as tk #-- constanten: width = 200 # breedte heigth = 200 # hoogte #-- start hoofdprogramma: root = tk.Tk() canvas = tk.Canvas(root, width=width, height=heigth) canvas.pack() #-- verander dit stuk, als je iets anders wil tekenen; #-- nu komt er een lijn ('line') en een rechthoek ('rectangle') canvas.create_line(0,0,width/2,heigth/2) canvas.create_rectangle(20, 40, 40, 60, fill="black", outline="") #-- laat dit stuk staan, zet er niets bij of onder usingIDLE = 0 if not usingIDLE: root.mainloop()