Screen placement based on screen resolution

Lonnie Princehouse finite.automaton at gmail.com
Fri Apr 7 15:14:53 EDT 2006


Tkinter takes strings as its arguments; it's TCL's legacy.  You can use
string formatting for this:

x = width/2-40
y = height/2-30

root.geometry('%ldx%ld+%ld+%ld' % (width, height, x, y))




More information about the Python-list mailing list