how can i get the screen width and height in pixels?

Gerson Kurz gerson.kurz at t-online.de
Mon Feb 4 12:27:07 EST 2002


On Mon, 4 Feb 2002 16:26:42 -0000, "G. Willoughby"
<sab at NOSPAM.freeuk.com> wrote:

>how can i get the screen width and height in pixels?

On Windows:
----------------
from win32api import *
from win32con import *

print "Screen width:", GetSystemMetrics(SM_CXSCREEN)
print "Screen height:", GetSystemMetrics(SM_CYSCREEN)
----------------
On Linux:

Buy a metric ruler, then construct a lego mindstorm robot to measure
the screen with that ruler. 

(Sorry folks, couldn't resist, I have nothing against linux, in fact I
like it :).




More information about the Python-list mailing list