HTMLify
9gqz21uqwx.py
Views: 127 | Author: guest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from textual.app import App from textual.containers import ScrollableContainer from textual.widget import Widget from threading import Thread from time import sleep class CustemWidget(Widget): def render(self): return "Something" class AutoUpdateApp(App): def compose(self): yield ScrollableContainer(CustemWidget()) def auto_updater(app): while True: sleep(1) try: app.query_one("ScrollableContainer").mount( CustemWidget() ) except Exception as e: app.notify(str(e)) open("log.log", "a").write("working") app = AutoUpdateApp() Thread(target=auto_updater, args=(app,)).start() app.run() |