使用 Python3.X 在 Windows 10 上控制屏幕亮度 [英] Control screen brightness on Windows 10 with Python3.X

查看:59
本文介绍了使用 Python3.X 在 Windows 10 上控制屏幕亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 Python 写一个脚本(这里是 3.5)来控制我的笔记本电脑屏幕的亮度(有一台 HP EliteBook,不知道它是否重要).有谁知道是否有一些代码/模块?

I want to write a script in Python (3.5 here) to control the brightness of the screen on my laptop (got a HP EliteBook, don't know if it's important). Does anyone know if there's some code/module for this ?

提前谢谢大家,祝你有美好的一天!

Thanks in advance everyone, have a good day !

推荐答案

终于找到了一种在 Windows 10 中与屏幕交互的方法.感谢 martineau,PyWin32 是解决方案的一部分.WMI 包是另一部分.

Finally found a way to interact with the screen in Windows 10. Thanks martineau, PyWin32 was a part of the solution. WMI package was the other part.

wmi.WMI(namespace='wmi').WmiMonitorBrightnessMethods()[0].WmiSetBrightness(brightness, 0)

其中亮度是 0 到 100 之间的整数.

where brightness is an int between 0 and 100.

这篇关于使用 Python3.X 在 Windows 10 上控制屏幕亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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