472,123 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,123 software developers and data experts.

screen size/resolution in win32 in python

Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.

Thanks in advance

Adrian

Mar 18 '07 #1
2 24928
adri80386 wrote:
Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.
You want the GetSystemMetrics function from the pywin32
packge:

<code>
from win32api import GetSystemMetrics
print "width =", GetSystemMetrics (0)
print "height =",GetSystemMetrics (1)

</code>
Mar 18 '07 #2
adri80386 wrote:
Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.

Thanks in advance

Adrian
Please think about the fact that people sometimes now have 2 and even
3 monitors. Don't do anything with this that would stretch your
application across all 2 (or 3) monitors. I think screensize isn't
going to give you enough information to automatically size or
position a window.

-Larry
Mar 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MSE | last post: by
9 posts views Thread by Les Juby | last post: by
3 posts views Thread by Chris | last post: by
5 posts views Thread by Maxi | last post: by
35 posts views Thread by Friendly_Lola | last post: by
3 posts views Thread by rahulnag22 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.