Creating 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:
Important
Any existing README.md or pyproject.toml (for example, created by uv init or poetry init)
will be replaced by the one created by flet create command.
The command will create the following directory structure:
📄 README.md
📄 pyproject.toml
📁 src
├── 📁 assets
│ └── 📄 icon.png
└── 📄 main.py # (1)!
📁 storage
├── 📄 data
└── 📄 temp
- Contains a simple Flet program.
It has
main()function where you would add UI elements (controls) to a page or a window. The application ends with aft.run()function which initializes the Flet app and runsmain().
You can find more information about flet create command here.
Now let's see Flet in action by running the app!