PythonByteSize
  • Home
  • Video Index
    • 1. The Basics
    • 2. Python Program Structures
    • 3. Python Operators
    • 4. Python Functions
    • 5. Introduction to Classes and Objects
    • 6. Python Strings
    • 7. User Defined Functions
    • 8. Classes and Objects
    • 9. Python Dictionaries
    • 10. Python tkinter
    • 11. Python Lists
    • 12. Python Namespaces
    • 13. Turtle Graphics
    • 14. Python Tips
  • Exercise Index
    • 1. The Basics Exercises
    • 2. Python Program Structures Exercises
    • 3. Python Operators Exercises
    • 4. Python Functions Exercises
  • Educators
  • Donate
  • Contact
  • Computing Topics
  • Mathematics
  • About

9. How to place a Python tkinter window in the center of the screen

This lesson looks at how a window can be placed in the center of a screen regardless as to the size of the window and the resolution of the monitor. It does so with the help of winfo_screenwidth() and winfo_screenheight(). Please note that the calculations do not take into account the title bar of the window. So think of the video as almost putting the window in the center.
<< Previous Video
Next Video >>
Please consider donating to help with the costs incurred in developing this website.             Donate >>