Trying to write a python application that downloads images from an RSS feed, and makes a composite background. How do I get the current desktop resolution on Mac OS X (leopard?)
解决方案
With Pyobjc something like this should work. Pyobjc comes with Leopard.
from AppKit import NSScreen
print(NSScreen.mainScreen().frame())
With that, you can also grab the width and height.
NSScreen.mainScreen().frame().size.width
NSScreen.mainScreen().frame().size.height
For example:
print("Current screen resolution: %dx%d" % (NSScreen.mainScreen().frame().size.width, NSScreen.mainScreen().frame().size.height))