Skip to content

Commit 6747160

Browse files
authored
Update README.md
1 parent 2574ef6 commit 6747160

File tree

1 file changed

+50
-6
lines changed

1 file changed

+50
-6
lines changed

README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,50 @@
1111

1212
# Textual
1313

14-
Build cross-platform user interfaces with a simple Python API.
14+
Build cross-platform user interfaces with a simple Python API. Run your apps in the terminal *or* a web browser.
1515

16-
Run your apps in the terminal *or* a web browser.
16+
Textual's API combines modern Python with the best of developments from the web world, for a lean app development experience.
17+
De-coupled components and an advanced [testing](https://textual.textualize.io/guide/testing/) framework ensure you can maintain your app for the long-term.
1718

19+
<img width="40%" align="right" alt="clock" src="https://github.com/user-attachments/assets/63e839c3-5b8e-478d-b78e-cf7647eb85e8" />
20+
21+
22+
```python
23+
"""
24+
An App to show the current time.
25+
"""
26+
27+
from datetime import datetime
28+
29+
from textual.app import App, ComposeResult
30+
from textual.widgets import Digits
31+
32+
33+
class ClockApp(App):
34+
CSS = """
35+
Screen { align: center middle; }
36+
Digits { width: auto; }
37+
"""
38+
39+
def compose(self) -> ComposeResult:
40+
yield Digits("")
41+
42+
def on_ready(self) -> None:
43+
self.update_clock()
44+
self.set_interval(1, self.update_clock)
45+
46+
def update_clock(self) -> None:
47+
clock = datetime.now().time()
48+
self.query_one(Digits).update(f"{clock:%T}")
49+
50+
51+
if __name__ == "__main__":
52+
app = ClockApp()
53+
app.run()
54+
```
55+
56+
57+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="64"/>
1858

1959
## Widgets
2060

@@ -78,6 +118,7 @@ Predefined themes ensure your apps will look good out of the box.
78118
</table>
79119

80120

121+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
81122

82123
## Installing
83124

@@ -90,6 +131,8 @@ pip install textual textual-dev
90131
See [getting started](https://textual.textualize.io/getting_started/) for details.
91132

92133

134+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
135+
93136
## Demo
94137

95138

@@ -105,6 +148,7 @@ Or try the [textual demo](https://github.com/textualize/textual-demo) *without*
105148
uvx --python 3.12 textual-demo
106149
```
107150

151+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
108152

109153
## Dev Console
110154

@@ -118,6 +162,8 @@ In addition to system messages and events, your logged messages and print statem
118162

119163
See [the guide](https://textual.textualize.io/guide/devtools/) for other helpful tools provided by the `textual-dev` package.
120164

165+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
166+
121167
## Command Palette
122168

123169

@@ -129,7 +175,7 @@ It is easy to extend the command palette with [custom commands](https://textual.
129175

130176
![Command Palette](https://github.com/user-attachments/assets/94d8ec5d-b668-4033-a5cb-bf820e1b8d60)
131177

132-
178+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
133179

134180
# Textual ❤️ Web
135181

@@ -151,10 +197,8 @@ Since Textual apps have low system requirements, you can install them anywhere P
151197
No desktop required!
152198

153199

200+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
154201

155-
## Documentation
156-
157-
Head over to the [Textual documentation](http://textual.textualize.io/) to start building.
158202

159203
## Join us on Discord
160204

0 commit comments

Comments
 (0)