How to understand Python tkinter padx parameters
This article introduces the relevant knowledge of "how to understand Python tkinter padx parameters". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Catalogue
1.padx
Running
1.padx
Represents the margin in the x-axis direction
The general usage is padx=10, which means that the length of the components on the left and right sides is 10.
It can also be used like this, padx= (20d10), which means that the length of the component on the left is 20 and the length of the component on the right is 10.
#-*-encoding=utf-8-*-import tkinterfrom tkinter import * if _ _ name__ ='_ _ main__': w = tkinter.Tk () w.geometry ('{} x {} + {} + {} '.format (200,200,100,100)) f = Frame () f.pack () tkinter.Button (f, text=' button 1') .pack (side=LEFT, padx=10) tkinter.Button (f, text=' button 2') .pack (side=LEFT) Padx=10) tkinter.Button (f, text=' button 3') .pack (side=LEFT, padx=10) F1 = Frame () f1.pack () tkinter.Button (F1, text=' button 1') .pack (side=LEFT, padx=10) tkinter.Button (F1, text=' button 2') .pack (side=LEFT, padx= (20,10) tkinter.Button (F1, text=' button 2') .pack (side=LEFT, padx= (0) 10) w.mainloop () runs "how to understand Python tkinter padx parameters" and that's it. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!