Running Flet Apps
Flet applications can be executed as desktop or web applications using the flet run command. This command initiates the app in a native OS window (desktop) or a web browser (web) with hot reload enabled for real-time updates.
Desktop App
To run a Flet app as a desktop application, use the flet run command. By default, it executes the main.py script in the current directory.
flet run [script][script] can be a relative or absolute path to the Python script.Web App
To run a Flet app as a web application, use the --web (or -w) option.
flet run --web [script]--port (or -p) followed by the port number.Watching for Changes
By default, Flet watches the main script file for modifications and reloads the app upon saving. It does not watch other files by default.
-d or --directory: Watch for changes only in the [script]'s directory.
* -r or --recursive: Watch for changes recursively in the [script]'s directory and all sub-directories.flet run --recursive [script]
Previous
arrow_back
Installation