We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
项目地址:https://github.com/flet-dev/flet
类别:python
亮点:不再需要 JavaScript 前端、REST API 后端、数据库、缓存等复杂架构。使用 Flet,您只需用 Python 编写一个整体式有状态应用程序,并获得多用户、实时单页应用程序 (SPA)。
示例代码:
安装依赖包
pip install flet
编写代码
counter.py
import flet from flet import IconButton, Page, Row, TextField, icons def main(page: Page): page.title = "Flet counter example" page.vertical_alignment = "center" txt_number = TextField(value="0", text_align="right", width=100) def minus_click(e): txt_number.value = int(txt_number.value) - 1 page.update() def plus_click(e): txt_number.value = int(txt_number.value) + 1 page.update() page.add( Row( [ IconButton(icons.REMOVE, on_click=minus_click), txt_number, IconButton(icons.ADD, on_click=plus_click), ], alignment="center", ) ) flet.app(target=main)
运行代码, 该应用程序将在本机操作系统窗口中启动 - 这是 Electron 的一个不错的替代品! python counter.py
python counter.py
如果您想将应用程序作为 Web 应用程序运行,只需将最后一行替换为: flet.app(target=main, view=flet.WEB_BROWSER)
flet.app(target=main, view=flet.WEB_BROWSER)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
推荐项目
项目地址:https://github.com/flet-dev/flet
类别:python
亮点:不再需要 JavaScript 前端、REST API 后端、数据库、缓存等复杂架构。使用 Flet,您只需用 Python 编写一个整体式有状态应用程序,并获得多用户、实时单页应用程序 (SPA)。
示例代码:
安装依赖包
pip install flet
编写代码
counter.py
运行代码, 该应用程序将在本机操作系统窗口中启动 - 这是 Electron 的一个不错的替代品!
python counter.py
如果您想将应用程序作为 Web 应用程序运行,只需将最后一行替换为:
flet.app(target=main, view=flet.WEB_BROWSER)
The text was updated successfully, but these errors were encountered: