mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
20 lines
372 B
Python
20 lines
372 B
Python
from textual.app import App, ComposeResult, RenderResult
|
|
from textual.widget import Widget
|
|
|
|
|
|
class Hello(Widget):
|
|
"""Display a greeting."""
|
|
|
|
def render(self) -> RenderResult:
|
|
return "Hello, [b]World[/b]!"
|
|
|
|
|
|
class CustomApp(App):
|
|
def compose(self) -> ComposeResult:
|
|
yield Hello()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app = CustomApp()
|
|
app.run()
|