Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control screen brightness on Windows 10 with Python3.X [closed]

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 !

like image 700
Antoine Auffray Avatar asked Jul 26 '26 10:07

Antoine Auffray


1 Answers

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)

where brightness is an int between 0 and 100.

like image 164
Antoine Auffray Avatar answered Jul 27 '26 22:07

Antoine Auffray



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!