Skip to content

Instantly share code, notes, and snippets.

@khangvan
Last active March 4, 2020 04:36
Show Gist options
  • Save khangvan/0bed7ccf51032215d38936bc4a654cdc to your computer and use it in GitHub Desktop.
Save khangvan/0bed7ccf51032215d38936bc4a654cdc to your computer and use it in GitHub Desktop.
[streamlit] graphviz #streamlit #python

href = f'Download CSV File'

How to run streamlit with custom config

--server.port

--browser.serverAddress

add config after "run"

activate base && streamlit run --server.port 5050 --browser.serverAddress vnmacsdb %~dp0mystreamlit.py
streamlit run --server.port 5050 https://gist.githubusercontent.com/treuille/e8f07ebcd92265a68ecec585f7594918/raw

note: not work as expectation

lỗi hay gặp là interpêtr dùng trên conda

check where python để lấy đúng env

c:\ProgramData\Anaconda3\python.exe

check where streamlit

c:\ProgramData\Anaconda3\Scripts\streamlit.exe

plan run app

c:\ProgramData\Anaconda3\Scripts\streamlit.exe run --server.port 5051 --browser.serverAddress vnmacsdb c:\Users\kvan_HTSCode\mystreamlit.py

run --server.port 5051 --browser.serverAddress vnmacsdb c:\Users\kvan_HTSCode\mystreamlit.py

importance> create batfile

activate base && streamlit run --server.port 5051 --browser.serverAddress vnmacsdb %~dp0mystreamlit.py

copy nssm

add app path

C:\Users\kvan_HTSCode\run_streamlit5051.bat

add i/o log at errro C:\Users\kvan_HTSCode\run_streamlit5051.log

import streamlit as st
import graphviz as graphviz
st.graphviz_chart('''
digraph {
run -> intr
intr -> runbl
runbl -> run
run -> kernel
kernel -> zombie
kernel -> sleep
kernel -> runmem
sleep -> swap
swap -> runswap
runswap -> new
runswap -> runmem
new -> runmem
sleep -> runmem
}
''')
myTuple = ["John", "Peter", "Vicky"]
start="'{}'".format(myTuple[0])
for x in myTuple[1:]:
start=start + ",'{}'".format(x)
print(start)

use taskscheduler to start at logon or ưhenever idele

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment