Advertisement
here2share

# Tk_center_window.py

Jun 12th, 2015
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. # Tk_center_window.py
  2.  
  3. import Tkinter
  4. root=Tkinter.Tk()
  5. x = (root.winfo_screenwidth() - root.winfo_reqwidth()) / 2
  6. y = (root.winfo_screenheight() - root.winfo_reqheight()) / 2
  7. root.geometry("124x24+%d+%d" % (x, y))
  8. label=Tkinter.Label(root,text='Hello ,World!')
  9. label.pack()
  10. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement