How do I get monitor resolution in Python?

后端 未结 30 1573
深忆病人
深忆病人 2020-11-22 13:49

What is the simplest way to get monitor resolution (preferably in a tuple)?

30条回答
  •  时光说笑
    2020-11-22 14:31

    And for completeness, Mac OS X

    import AppKit
    [(screen.frame().size.width, screen.frame().size.height)
        for screen in AppKit.NSScreen.screens()]
    

    will give you a list of tuples containing all screen sizes (if multiple monitors present)

提交回复
热议问题