469,594 Members | 2,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,594 developers. It's quick & easy.

Getting current screen resolution

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?

--
Thomas Morton

Lead Developer || Founder
TomNRob Web Services
www.tomnrob.com
Jun 27 '08 #1
3 3029
Hello,
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?
Maybe one of Tkinter.Tk winfo_* methods?

HTH,
--
Miki <mi*********@gmail.com>
http://pythonwise.blogspot.com
Jun 27 '08 #2
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
Jun 27 '08 #3

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.......

Tom
--------------------------------------------------
From: "Larry Bates" <la*********@websafe.com`>
Sent: Monday, June 09, 2008 11:16 PM
Newsgroups: comp.lang.python
To: <py*********@python.org>
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
--
http://mail.python.org/mailman/listinfo/python-list
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by JIM.H. | last post: by
1 post views Thread by Carlos Albert | last post: by
5 posts views Thread by Maxi | last post: by
4 posts views Thread by pedestrian via DotNetMonster.com | last post: by
9 posts views Thread by Steve Wright | last post: by
3 posts views Thread by Joe Withawk | last post: by
reply views Thread by William Heymann | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.