Need a browser-based interface for a Python task manager? Streamlit turns a Python script into a web app and provides widgets such as buttons and text inputs. It lays out those elements for you, so you can focus on the app’s behavior rather than its page layout. section 14.2.1 section 14.4.1
Install Streamlit in an activated virtual environment with `pip install streamlit==1.10.0`. To launch a script, run `streamlit run taskier_app.py` from its directory. The app opens in a tab in your default browser; use that tab to check changes while developing. section 14.1.3 section 14.4.9
The key execution detail is that a change to an input reruns the entire script from top to bottom. Keep information needed across those reruns in `st.session_state`, a key-value store for the active browser session. A task manager can retain its selected page, current task, and sorting and filtering choices there. section 14.4.1 section 14.4.3
Listing 14.9 Calling the functions to create the web app
if __name__ == "__main__":
init_session() #1
setup_sidebar()
if session[menu_key] == TaskierMenuOption.SHOW_TASKS.value:
show_tasks()
elif session[menu_key] == TaskierMenuOption.NEW_TASK.value:
show_new_task_entry()
elif session[menu_key] == TaskierMenuOption.SHOW_TASK_DETAIL.value:
show_task_detail()
else:
st.write("No matching menu")
This entry point initializes session state, sets up the sidebar, then calls the function for the selected page. The branches make page navigation explicit in the script that Streamlit runs. section 14.4.3
Keep the app script focused on interface configuration: put imports first, then shared variables and functions grouped by purpose. Place a substantial data model in a separate file and import it. That makes the interface easier to read and leaves the model available for other kinds of app. section 14.4.8








