import streamlit as st
'Simple Calculator App')
st.title(
= st.number_input(label="First Number")
num_1
= st.number_input(label="Second Number")
num_2
= st.selectbox(label="Operation", options=["Add", "Subtract", "Multiply", "Divide"])
operator
if operator == "Add":
= num_1 + num_2
output elif operator == "Subtract":
= num_1 - num_2
output elif operator == "Multiply":
= num_1 * num_2
output elif operator == "Divide":
= num_1 / num_2
output
f"The answer is {output}") st.text(
29 App Colours
There are a few parts of Streamlit’s theming that we can officially change using a configuration file.
This file needs to be called config.toml and lives inside a subfolder called .streamlit
The config.toml file contains a variable number of parameters.
It can determine whether the default colourscheme is light or dark, and whether the default streamlit colours are overridden.
You can create a template config.toml from within streamlit, then paste the output into a config.toml file you create yourself.
Let’s look at an example app.
29.0.1 config.toml
[theme]
base="light"
primaryColor="#005EB8"
secondaryBackgroundColor="#00e0ff"