-1
from tkinter import *
root = Tk()
root.geometry("500x500+0+0")
startbutton = Button(anchor=CENTER, text="Start",height=1,width=4)
startbutton.pack()
root.mainloop()

This is my code , button gets displayed only in the center of the x axis.

1 Answers1

1

use tkinter funtions to get the screen size

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()

then set the location of it

Equan Ur Rehman
  • 229
  • 1
  • 2
  • 11