Perhaps this will help:
Code:import subprocess #Run the xrandr command within a shell, redirecting stdout. result = subprocess.Popen("xrandr --current --verbose | grep Brightness | sed 's/[^0-9.]*//g'", shell=True, stdout=subprocess.PIPE) #Print the first line of stdout, as a floating-point number print(float(result.stdout.read().split()[0]))
Bookmarks