From 5049f63568e21e4a63c35862b7702afbb7c337d3 Mon Sep 17 00:00:00 2001 From: mohsen Date: Mon, 15 Jul 2024 19:08:58 +0330 Subject: [PATCH] query parameter is added --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index c0d3a0a..0dd4704 100644 --- a/main.py +++ b/main.py @@ -52,7 +52,11 @@ def sfmono(): if "token" in st.session_state: df = pd.read_csv("data.csv").dropna() list_of_name = df['name'].to_list() - name = st.sidebar.selectbox("لیست سهام", options = list_of_name) + if "stock" in st.query_params: + STOCK_INDEX = list_of_name.index(st.query_params.stock) + else: + STOCK_INDEX = 0 + name = st.sidebar.selectbox("لیست سهام", options = list_of_name, index=STOCK_INDEX) queries = Queries(name)