Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

center button in tkinter

import tkinter as tk
root=tk.Tk()
root.geometry("300x275")

B=tk.Button(root,text="button",command= lambda:fun() ,width=5,font=("Arial",14))
B.grid(columnspan=5,row=5,column=2)
B.place(relx=0.5, rely=0.5, anchor='center')

root.mainloop()
Comment

center buttons tkinter

button.place(relx=0.5, rely=0.5, anchor=CENTER)
Comment

PREVIOUS NEXT
Code Example
Python :: bar chart with seaborn 
Python :: django foreign key field on delete do nothing 
Python :: convert 1 digit to 2 digit python 
Python :: drop columns pandas 
Python :: f string curency format 
Python :: python read toml file 
Python :: matplotlib histogram 
Python :: convert list of int to string python 
Python :: How to check how much time elapsed Python 
Python :: recursionerror maximum recursion depth 
Python :: join two numpy 2d array 
Python :: how to join a string by new line out of a list python 
Python :: pandas standardscaler 
Python :: get columns based on dtype pandas 
Python :: get video length python 
Python :: string array to float array python 
Python :: django admin slug auto populate 
Python :: use python3 as default mac 
Python :: pandas sample rows 
Python :: figure title python 
Python :: python flat list from list of list 
Python :: python discord discord.py disable remove help command 
Python :: Change date format on django templates 
Python :: python print to terminal with color 
Python :: how to read a json resposnse from a link in python 
Python :: get desktop location python 
Python :: pygame python3.8 
Python :: pie chart python pandas 
Python :: matplotlib plot dpi 
Python :: factorial python for loop 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =