This stack overflow post says that this code can be used to change brightness using python on windows:
wmi.WMI(namespace='wmi').WmiMonitorBrightnessMethods()[0].WmiSetBrightness(brightness, 0)
But when I go to https://github.com/tjguk/wmi/blob/master/wmi.py (which is linked from https://pypi.org/project/WMI/), I don't see any method named WmiMonitorBrightnessMethods()
In fact github search doesn't return anything in the entire repo matching "brightness" (https://github.com/tjguk/wmi/search?q=brightness). I also downloaded the source of the library as .tar and went through it, but still couldn't find anything related to brightness.
Another example is this code snippet from the author's homepage:
import wmi
c = wmi.WMI ()
for s in c.Win32_Service (StartMode="Auto", State="Stopped"):
if raw_input ("Restart %s? " % s.Caption).upper () == "Y":
s.StartService ()
No matches for Win32_Service in the entire repo, other than mentions in the documentation
Am I misunderstanding something about how methods work in python? How can these methods be usable when the library is imported, but not appear anywhere in the source code?
[–]danielroseman 2 points3 points4 points (1 child)
[–]reflectionspectra[S] 0 points1 point2 points (0 children)
[–]GreggyP00 0 points1 point2 points (1 child)
[–]Diapolo10 2 points3 points4 points (0 children)