Skip to main content

Streamlit Space

Streamlit allows users to freely build a fully functional web application in a responsive manner using Python.

Create Streamlit Space

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

Init

After creation, the system automatically generates only a README and a .gitattribute file for the user. At this point, the status of the space is Uninitialize. The space requires a program file to run, and reference code for app.py is provided on the 'App' page. init space

Copy the following reference code:

import streamlit as st

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

Switch to the "Files" page, click "Add File", then select "Create File" from the dropdown menu. Paste the code into the editor and name the file app.py. After that, click "Create File." Create file

Running

After the app.py file is commited, the space will automatically start building the app. Once the build is complete, you can view the running results of the app. Running Demo

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