Create a new Flet app
Create a new directory (or directory with pyproject.toml
already exists if initialized with poetry
or uv
) and switch into it.
To create a new "minimal" Flet app run the following command:
- venv
- uv
- poetry
flet create
uv run flet create
poetry run flet create
The command will create the following directory structure:
├── README.md
├── pyproject.toml
├── src
│ ├── assets
│ │ └── icon.png
│ └── main.py
└── storage
├── data
└── temp
note
Original pyproject.toml
created by uv init
or poetry init
will be replaced with the one from Flet app template.
src/main.py
contains Flet program. It has main()
function where you would add UI elements (controls) to a page or a window. The application ends with a blocking ft.app()
function which initializes Flet app and runs main()
.
You can find more information about flet create
command here.
Now let's see Flet in action by running the app!