Python练习_tkinter画布create_line画格子图

Python练习_tkinter画布create_line画格子图

李兴球Python画格子图tkinter create_line

import time
from tkinter import *

root = Tk()

cv = Canvas(root,width=480,height=360,bg='cyan')
cv.pack()

for r in range(10):
    cv.create_line(0,r * 36,480,r*36,fill='red',width=2)
 
for c in range(10):
    cv.create_line(c*48,0,c*48,360,fill='red',width=2)

李兴球

李兴球的博客是Python创意编程原创博客