...

/

Display Code with Streamlit

Display Code with Streamlit

Learn to display code with Streamlit.

We'll cover the following...

We can display code in two ways.

Display code without execution

To display a block of code, we use the st.code() method:

import streamlit as st
st.markdown("## Display code without execution")
code = '''st.audio("https://bit.ly/rainaws3")'''
st.code(code, language='python')
...