File: from_pydict_with_col_labels.py

package info (click to toggle)
textual-fastdatatable 0.12.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,856 kB
  • sloc: python: 3,461; makefile: 24
file content (20 lines) | stat: -rw-r--r-- 443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from textual.app import App, ComposeResult
from textual_fastdatatable import DataTable

DATA = {
    "Foo": list(range(50)),
    "Bar": ["0123456789"] * 50,
    "Baz": ["IJKLMNOPQRSTUVWXYZ"] * 50,
}


class TableApp(App):
    def compose(self) -> ComposeResult:
        yield DataTable(
            data=DATA, column_labels=["[red]Not Foo[/red]", "Zig", "[reverse]Zag[/]"]
        )


app = TableApp()
if __name__ == "__main__":
    app.run()