Streamlit

AkashAkash
1 min read

Streamlit is a Python library that is used to create webpages. Streamlit does not require programmers to have knowledge of HTML, CSS, or JavaScript.

Streamlit writes declarative Python code.

How to initialise a Streamlit Project

uv init {project name)
uv add streamlit

How to Run

In my case, streamlit run app.js , so I used it.

But if it doesn’t work for you, then Use:

uvx streamlit run main.py

where main.py is your filename

How to Write Streamlit Code

title

import streamlit as st
st.title("Programming Language Picker")

subheader

st.subheader("Welcome to Programming Language Picker")

text

st.text("This is programming language picker in which you are given option to choose one language")

write

st.write("Here is programming Language Picker")

selectbox

To create an option picker, st.selectbox( “ “, [ ] ) is used. Where inside the quote title goes “title of options” and a list is also passed, and each member of the list is an option.

st.selectbox("Your Favourite Language", ["JavaScripts", "Python", "Kotlin", "C++"])

You can also store it in a variable and use it later.

success

st.success("Thank You for choosing Language")

How our Site looks:

10
Subscribe to my newsletter

Read articles from Akash directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Akash
Akash

A self-learner deep diving in the world of Python, GenAi and Web Development.