How do I get monitor resolution in Python?

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

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

30条回答
  •  渐次进展
    2020-11-22 14:53

    Using Linux, the simplest way is to execute bash command

    xrandr | grep '*'
    

    and parse its output using regexp.

    Also you can do it through PyGame: http://www.daniweb.com/forums/thread54881.html

提交回复
热议问题