Skip to content

Instantly share code, notes, and snippets.

@Geek-a-Byte
Last active May 1, 2023 05:10
Show Gist options
  • Save Geek-a-Byte/833d306bc8e94624a6832a56892c47e7 to your computer and use it in GitHub Desktop.
Save Geek-a-Byte/833d306bc8e94624a6832a56892c47e7 to your computer and use it in GitHub Desktop.
# https://www.youtube.com/watch?v=MUD-pBOnvdo&t=8s&ab_channel=1littlecoder
#install streamlit, one time execution
!pip install streamlit
#import streamlit
import streamlit as st
# Commented out IPython magic to ensure Python compatibility.
# %%writefile app.py
# import numpy as np
# import streamlit as st
# import pandas as pd
# from sklearn import datasets
# from sklearn.ensemble import RandomForestClassifier
#
# st.write(''' # Cervical Cancer Classification App''')
!pip install pyngrok
from pyngrok import ngrok
ngrok.set_auth_token("") #ngrok.com
!nohup streamlit run app.py --server.port 80 &
url = ngrok.connect(port = '80')
print(url)
# check which ports are connected
tunnels = ngrok.get_tunnels()
tunnels
## to kill the port connections
ngrok.kill()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment