kv = \
"""
<MyApp>
MDScreen:
ScreenManager:
id: screen_manager
Screen:
name: "main"
MDRoundFlatIconButton:
text: "ip"
pos_hint: {"right": 0.2, "top": 0.9}
on_release:
app.screen("ip")
Screen:
name: "ip"
"""
class MyApp(MDApp):
def build(self):
self.theme_cls.theme_style = "Dark"
self.title = "Ji_hack :3"
return Builder.load_string(kv)
def screen(self, sc):
self.root.ids.screen_manager.current = sc
MyApp().run()
Как объявить переменную ip = socket.gethostbyname(socket.gethostname()) и вписать в kv?