Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Python GUI - Widget and Root

Below both snippet returns the same result. Anyone, please share with us how both works? the internal difference, which is good? etc..,

Snippet 1:

from tkinter import *
widget = Button(None, text='Press me to quit' , command=quit)
widget.pack()
widget.mainloop()

Snippet 2:

from tkinter import *
root = Tk()
Button (root, text='Press Me', command=root.quit).pack(side=LEFT)
root.mainloop()

Comments

Post Details

Added on Jul 15 2021
0 comments
225 views