Update app.py
Browse files13 unmodified lines141516171819202122232425262728293031323333 unmodified lines6768697071727374757677787913 unmodified lineswarnings.simplefilter(action='ignore', category=FutureWarning)l = []text_input = 'BTC-USD' # Replace with your desired cryptocurrency symbol#data = yf.download(text_input, period='max')# Fetch historical data for BTC-USDdef predict_and_save_close_price():data = pd.DataFrame() # Initialize data as an empty DataFrame# Fetch historical datatry:data = yf.download(text_input, period='max')except:passif data.empty:return# Select Open and Close pricedata = data[['Open', 'Close']].copy() # Use .copy() to avoid the SettingWithCopyWarning33 unmodified linesl.append(predicted_close)# Schedule the function to run every minuteschedule.every(1).minutes.do(predict_and_save_close_price)# Run the scheduling loopif st.button('pezh'):while True:schedule.run_pending()time.sleep(1)if st.button('pezho'):st.write(l)13 unmodified lines141516171819202122232425262728293031323333 unmodified lines6768697071727374757677787913 unmodified lineswarnings.simplefilter(action='ignore', category=FutureWarning)l = []text_input = 'BTC-USD' # Replace with your desired cryptocurrency symboldata = yf.download(text_input, period='max')# Fetch historical data for BTC-USDdef predict_and_save_close_price():#data = pd.DataFrame() # Initialize data as an empty DataFrame# Fetch historical data#try:#data = yf.download(text_input, period='max')#except:#pass#if data.empty:#return# Select Open and Close pricedata = data[['Open', 'Close']].copy() # Use .copy() to avoid the SettingWithCopyWarning33 unmodified linesl.append(predicted_close)# Schedule the function to run every minute#schedule.every(1).minutes.do(predict_and_save_close_price)# Run the scheduling loop#if st.button('pezh'):#while True:#schedule.run_pending()#time.sleep(1)if st.button('pezho'):st.write(l)
app.py+13-13