By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,856 Members | 2,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,856 IT Pros & Developers. It's quick & easy.

screen size/resolution in win32 in python

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.