在 Ubuntu 上用 Python 获取显示器分辨率 [英] Getting Monitor resolution in Python on Ubuntu

查看:112
本文介绍了在 Ubuntu 上用 Python 获取显示器分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 Ubuntu,在 win32api 中是否有等同于 GetSystemMetrics 的代码?我需要以像素为单位获取显示器的宽度和高度.

Is there a equatable bit of code to GetSystemMetrics in win32api, for Ubuntu? I need to get the monitors width and height in pixels.

推荐答案

我假设您是一个 GUI 工具包.您为什么会对屏幕尺寸感兴趣?

I assume you're a GUI toolkit. Why else would you be interested in the screen dimensions?

查看 PyGTK 的 gtk.gdk.screen_width()gtk.gdk.screen_height().QT 应该有类似的东西.

Check out gtk.gdk.screen_width() and gtk.gdk.screen_height() from PyGTK. Something similar should be available for QT.

这篇关于在 Ubuntu 上用 Python 获取显示器分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆