widgets in Python using tkinter
In the following code, why pack() is not used and still it is working ? Also while using mainloop() , there is no prefix widget object and still it works ? https://code.sololearn.com/c9FCgn9eXXe4 (It will not work in the online IDE)
Diego please see this
mainloop() can be used without a widget object. There's not much difference in the normal case. >>> help(tkinter.Tk.mainloop) mainloop(self, n=0) Call the mainloop of Tk. >>> help(tkinter.mainloop) mainloop(n=0) Run the mainloop of Tcl. Where would widget.pack() be in your code?
Diego widget.pack() is not in this code but generally I had used only pack() and it is still working in other code Also what is Tcl ? When should we use mainloop() and when wd.mainloop() (wd is the name of random widget)
Tcl: Embeddable scripting language. Tk: GUI toolkit and widgets based on Tcl. https://wiki.tcl-lang.org/page/An+Overview+of+Tcl+and+Tk About mainloop() vs widget.mainloop(): https://stackoverflow.com/questions/51428209/ Same answer goes for pack() and widget.pack().
Diego thanks. Also there is an answer on stackoverflow about pack( ) topic which is very useful. You can also refer.
I have tried every way I could find but still I can't display my local images ..what am I doing wrong?
I cant understand what the problem here is. Can anyone help me out? the system in sololearn called it an error in test case 1
Izzy the iguana code coach