前言
在使用ttkbootstrap库时,发现icon参数使用报错,错误代码
root = ttk.Window(
    themename="superhero",
    size=(1400, 700),
    resizable=(True, True),
    iconphoto="1.png"
)
结果报错:iconphoto path is bad; using default image.
 
 后面才发现这个参数支持的png格式或者gif格式,正确的代码
root = ttk.Window(
                themename="superhero",
                size=(1400, 700),
                resizable=(True, True),
                iconphoto="1.png",
                )
f = ttk.Frame(root)
这次显示成功了



















