[course]03 —— 画图
1. 创建一个空的canvas
from tkinter import *
def draw(canvas, width, height):
pass # replace with your drawing code!
def runDrawing(width=300, height=300):
root = Tk()
root.resizable(width=False, height=False) # prevents resizing window
canvas = Canvas(root, width=width, height=height)
canvas.configure(bd=0, highlightthickness=0)
canvas.pack()
draw(canvas, width, height)
root.mainloop()
print("bye!")
runDrawing(400, 200)2. Canvas坐标系

3. Draw a Line
Last updated

