A bit of a hack, but this works:
from Tkinter import * r = Tk() r.withdraw() width, height = r.winfo_screenwidth(), r.winfo_screenheight()
Another variant:
from commands import getstatusoutput status, output = getstatusoutput("xwininfo -root") width = re.compile(r"Width: (\d+)").findall(output)[0] height = re.compile(r"Height: (\d+)").findall(output)[0]
source share