get screen size in python
Question: > **Possible Duplicate:**  
>  [How do I get Monitor resolution in
> Python?](http://stackoverflow.com/questions/3129322/how-do-i-get-monitor-
> resolution-in-python)

I was wondering if there was a way to get the screen size from a python
script.

**Similar Questions:**

[Getting monitor size in
python](http://stackoverflow.com/questions/2662857/getting-monitor-size-in-
python)

This question tells you how to get it through pygame. Is there a way to do it
with just python? I need the scripts to run on several Unix-based operating
system.


Answer: I stole this from [Finding the workspace size (screen size less the taskbar)
using GTK](http://stackoverflow.com/questions/502282/finding-the-workspace-
size-screen-size-less-the-taskbar-using-gtk)

    
    
    import gtk, pygtk
    
    window = gtk.Window()
    screen = window.get_screen()
    print "width = " + str(screen.get_width()) + ", height = " + str(screen.get_height())
    

Just to let you know, if you have multiple monitors the screen's size will be
all of those monitors together.

