Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.

License

NotificationsYou must be signed in to change notification settings

Textualize/textual

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

DiscordSupported Python VersionsPyPI versionOS support

textual-splash

Textual

clock

Build cross-platform user interfaces with a simple Python API. Run your apps in the terminalor a web browser.

Textual's API combines modern Python with the best of developments from the web world, for a lean app development experience.De-coupled components and an advancedtesting framework ensure you can maintain your app for the long-term.

Want some more examples? See theexamples directory.

"""An App to show the current time."""fromdatetimeimportdatetimefromtextual.appimportApp,ComposeResultfromtextual.widgetsimportDigitsclassClockApp(App):CSS="""    Screen { align: center middle; }    Digits { width: auto; }    """defcompose(self)->ComposeResult:yieldDigits("")defon_ready(self)->None:self.update_clock()self.set_interval(1,self.update_clock)defupdate_clock(self)->None:clock=datetime.now().time()self.query_one(Digits).update(f"{clock:%T}")if__name__=="__main__":app=ClockApp()app.run()

Tip

Textual is an asynchronous framework under the hood. Which means you can integrate your apps with async libraries — if you want to.If you don't want or need to use async, Textual won't force it on you.

Widgets

Textual's library ofwidgets covers everything from buttons, tree controls, data tables, inputs, text areas, and more…Combined with a flexiblelayout system, you can realize any User Interface you need.

Predefined themes ensure your apps will look good out of the box.

buttons

tree

datatables

inputs

listview

textarea

Installing

Install Textual via pip:

pip install textual textual-dev

Seegetting started for details.

Demo

Run the following command to see a little of what Textual can do:

python -m textual

Or try thetextual demowithout installing (requiresuv):

uvx --python 3.12 textual-demo

Dev Console

devtools

How do you debug an app in the terminal that is also running in the terminal?

Thetextual-dev package supplies a dev console that connects to your application from another terminal.In addition to system messages and events, your logged messages and print statements will appear in the dev console.

Seethe guide for other helpful tools provided by thetextual-dev package.

Command Palette

Textual apps have afuzzy search command palette.Hitctrl+p to open the command palette.

It is easy to extend the command palette withcustom commands for your application.

Command Palette

Textual ❤️ Web

textual-serve

Textual apps are equally at home in the browser as they are the terminal. Any Textual app may be served withtextual serve — so you can share your creations on the web.Here's how to serve the demo app:

textual serve "python -m textual"

In addition to serving your apps locally, you can serve apps withTextual Web.

Textual Web's firewall-busting technology can serve an unlimited number of applications.

Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device into a connected device.No desktop required!

Join us on Discord

Join the Textual developers and community on ourDiscord Server.

About

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors187

Languages


[8]ページ先頭

©2009-2025 Movatter.jp