st.write() Method in Streamlit
The st.write() method displays content in a Streamlit app. Unlike other Streamlit commands, it has unique properties that make it very flexible.
Key Features
- You can pass multiple arguments, and all will be displayed.
- Its behavior automatically adapts based on the input type.
- Supports text, Markdown, dataframes, charts, and Python objects.
Syntax
st.write(*args, unsafe_allow_html=False)
Example
Python
import streamlit as st
# Versatile output
st.write("**Markdown** style or any object") The output of the above code is shown below:
