Adding a background image in python

后端 未结 3 1222
猫巷女王i
猫巷女王i 2021-01-05 15:15

I\'m trying to add a background image to a canvas in Python. So far the code looks like this:

from Tkinter import *
from PIL import ImageTk,Image

... other          


        
3条回答
  •  -上瘾入骨i
    2021-01-05 15:54

    just change to :

        image = Image.open("~~~path.png")
        backgroundImage=ImageTk.PhotoImage(image)
    

    believe me this will 100% work

提交回复
热议问题