how to fix a "TCL error" in Tkinter Python ? working on Jupyter Notebook how to fix a "TCL error" in Tkinter Python ? working on Jupyter Notebook tkinter tkinter

how to fix a "TCL error" in Tkinter Python ? working on Jupyter Notebook


You passed window as a parameter in list1.configure which is not required. Also you need to specify sticky location if you use grid on your scrollbar.

from tkinter import *# user interfacewindow = Tk()list1 = Listbox(window, height=15, width=28)list1.grid(row=3, column=0)for i in range(30):    list1.insert(END,i) #dummy datasb1 = Scrollbar(window)sb1.grid(row=3, column=1,sticky="ns")list1.configure(yscrollcommand=sb1.set)sb1.configure(command=list1.yview)window.mainloop()


My code:

mybot = Tk()mybot.geometry("300x600")mybot.title("MyChatBot")pic = PhotoImage(file = "bott.jpg")img = Label(mybot, image = pic)img.pack(pady = 10)mybot.mainloop()

Generates this Error:

TclError: couldn't recognize data in image file "bott.jpg" my problem .couldnot solve yet.