Getting current screen resolution

Thomas Morton morton.thomas at
Tue Jun 10 09:28:14 CEST 2008

Yeh that's not such an issue - this is for some basic image analysis for a 
document / report. It's not HUGELY important data (it can be wrong with no 
real come back) but it has to be roughly accurate...

The idea is I have an image and I need to work out how big it displays on 
the monitor of the computer running the script :)

Thanks for the replies so far ppl :) I think I might have it.......

From: "Larry Bates" <larry.bates at`>
Sent: Monday, June 09, 2008 11:16 PM
Newsgroups: comp.lang.python
To: <python-list at>
Subject: Re: Getting current screen resolution

> Thomas Morton wrote:
>> This is a "thing" that has been annoying me all morning: and I can't
>> work out how to do it.
>> I need a way to get the DPI or screen resolution of the monitor that a
>> script is currently runnign on.
>> I have a way in Windows but it doesnt port to Unix (which is important).
>> Any ideas?
> warning - be very careful about trying to come up with something like 
> this.
> Today it is common for people to have more than one monitor, so you will 
> need to take that into account.  Just getting resolution of one monitor 
> might not be enough (but then I don't know EXACTLY what is is that you are 
> doing with the
> resolution).  I see a lot of software that ignores the dual-monitor 
> possibility.
> -Larry
> --

More information about the Python-list mailing list