I’ve assigned an on_funtion to a button .Which is supposed to run a python file and start capturing the webcam. It should only be started when the button is clicked . But whenever i run the streamlit server the function runs and start capturing without a click event
import subprocess
import sys
import streamlit as st
from activity_check import high_count
act_lev = ""
def start_capture(act_lev):
subprocess.run([f"{sys.executable}", "activity_check.py"])
def run_cap():
st.button("Start Capturing",on_click=start_capture)
run_cap()
st.write(high_count)
Any idea why this is happening?