宿題


from Tkinter import *
x = 40
y = 240
z = 80
canvas = Canvas(bg = '#ffff00', width=640, height=480)
canvas.pack(expand=YES, fill=BOTH)
canvas.create_line(0, 0, 640, y*2, fill = '#000000')
canvas.create_line(0, y, 640, y, fill = '#000000')
canvas.create_line(320, 0, 320, y*2, fill = '#000000')
canvas.create_line(0, y*2, 640, 0, fill = '#000000')
canvas.create_text(x,z,fill = '#000000', text = "YES")
canvas.create_text(x,z*2,fill = '#000000', text = "good bye")
canvas.create_text(x,z*3,fill = '#000000', text = "stop")
canvas.create_text(x,z*4,fill = '#000000', text = "low")
canvas.create_text(x,z*5,fill = '#000000', text = "why")
canvas.create_text(600,z,fill = '#000000', text = "NO")
canvas.create_text(600,z*2,fill = '#000000', text = "hello")
canvas.create_text(600,z*3,fill = '#000000', text = "go,go,go")
canvas.create_text(600,z*4,fill = '#000000', text = "high")
canvas.create_text(600,z*5,fill = '#000000', text = "I don't know")

mainloop()

Comments are closed.