from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.widget import Widget
import psutil
battery = psutil.sensors_battery()
percent = str(battery.percent)
class Application(App):
def build(self):
return Label(text = percent + "%")
while True:
Application().run()
The label does not change, even though the percent variable has changed. Though the computer shows the battery level 60%, the app shows the battery level of when the App started.