Hello everyone!
I recently came across a way to launch a streamlit app from a Google Colab Notebook and wanted to share this with you.
Google Colab is a free cloud service for machine learning and artificial intelligence made available by Google. It provides a Jupyter notebook environment which can be used to code, debug, analyze data and more. It is a great platform for quickly prototyping and experimenting, making development much faster and efficient.
Run a Streamlit App on Google Colab Notebook
Launch google Colab, and create a new Notebook https://colab.research.google.com/
.
Install Streamlit library
!pip install -q streamlit
Create a streamlit app example
%%writefile app.py
import streamlit as st
st.write('Hello, *World!* :sunglasses:')
Install localtunnel to serve the Streamlit app
!npm install localtunnel
Run the Streamlit app in the background
!streamlit run app.py &>/content/logs.txt &
Expose the Streamlit app on port 8501
Then just click in the url
showed.
!npx localtunnel --port 8501
If you find this helpful Select on the post. Please feel free to leave a comment if you have any questions.
Thank you!