Skip to main content

Streamlit Space

Streamlit gives users freedom to build a full-featured web app with Python in a reactive way.

Create Streamlit Space

In the process of Create Space, select Streamlit SDK will create a Streamlit Space. select sdk

Init

The Space system will create README.md and .gitattribute file automaticly after you create a new space repository. The status of this new space is Uninitialize. init space

To run the Streamlit app, make a new file in the repository called app.py, and add the following code:

  import streamlit as st

x = st.slider('Select a value')
st.write(x, 'squared is', x * x)

An easy way to new a file is in Files tab. Click "Add File" button, select "Create new file". Paste the code in edit box, and put the filename as "app.py". Then click "Create File". Create File

Running

The Space app will build automaticly after you commit app.py. You can check the app and files here Demo

You can change the code in app.py, create what you like in OpenCSG community!