from tkinter import * # This will import everything from tkinter root = Tk() # Is the Tk window # Button One cool_button = Button(root, text="Click Me!") # Defining a button cool_button.pack(side=LEFT) # Putting button on screen # Button Two cool_button1 = Button(root, text="Click Me!") # Defining a button cool_button1.pack(side=RIGHT) """ There is pack, grid & place """ root.mainloop() # Is the END of loop
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter