I am running a simple little test program in python 2, but the canvas is not appearing.
from Tkinter import *
tk = Tk()
canvas = Canvas(tk, width=600, height=600)
canvas.pack()
canvas.create_rectangle(250, 250, 350, 350)
Tkinter need to pack your frame. :-p
add
tk.mainloop()
to the end of your program
By the way, canvas is also in same colour as tkinter frame. So, consider adding colour to canvas. So, that you can identify it.
canvas.config(bg = 'Black')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.