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

Getting current screen resolution

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


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

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

P: n/a

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.