Need advice on running asyncio in streamlit

@hack-r Thank you for the pointer!

using custom executor didn’t work for me.

For now, I’m going with this workaround - Invoking a Python subprocess as mentioned in here

import streamlit as st
import subprocess
import sys
import pandas as pd

if st.button("CHECK RSSI"):
    subprocess.run([f"{sys.executable}", "util_checkRSSI.py"])
    df_result = pd.read_csv("./result_rssi.csv")
    st.dataframe(df_result)

it’s a bit messy but i don’t get asyncio errors :slight_smile:

1 Like