Spaces:
Paused

ll7098ll commited on
Commit
dbdb74e
ยท
verified ยท
1 Parent(s): 6eaca16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -277,6 +277,7 @@ def explain_daily_news_meanings(daily_news):
277
 
278
 
279
  def buy_stock(stock_name, quantity, sector):
 
280
  if sector not in st.session_state['stocks'] or stock_name not in st.session_state['stocks'][sector]: # ์„นํ„ฐ ์ •๋ณด๋กœ ํ™•์ธ
281
  st.session_state['messages'].append({"type": "error", "text": "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ฃผ์‹ ์ข…๋ชฉ์ž…๋‹ˆ๋‹ค."})
282
  return
@@ -486,6 +487,7 @@ def display_portfolio_table(): # display_portfolio() ๋ฅผ dataframe ํ‘œ์‹œ์šฉ์œผ
486
  st.info("๋ณด์œ  ์ฃผ์‹์ด ์—†์Šต๋‹ˆ๋‹ค.")
487
 
488
 
 
489
  # --- ๋ฉ”์ธ ํ™”๋ฉด ---
490
  def main():
491
  col_news, col_main_ui = st.columns([1, 2])
@@ -616,6 +618,7 @@ def main():
616
  st.info(f"**{selected_stock_buy}** ํ˜„์žฌ ์ฃผ๊ฐ€: {stock_price_buy:,.0f}์›") # info box ์‚ฌ์šฉ
617
  quantity_buy = st.number_input("๋งค์ˆ˜ ์ˆ˜๋Ÿ‰ (์ฃผ):", min_value=1, value=1, step=1) # Label ์ถ”๊ฐ€
618
  if st.button("์ฃผ์‹ ๋งค์ˆ˜", use_container_width=True): # ๋ฒ„ํŠผ ํ…์ŠคํŠธ ๋ณ€๊ฒฝ
 
619
  buy_stock(selected_stock_buy, quantity_buy, selected_sector_buy)
620
 
621
  elif menu == '์ฃผ์‹ ๋งค๋„':
 
277
 
278
 
279
  def buy_stock(stock_name, quantity, sector):
280
+ st.write(f"buy_stock called with: stock_name={stock_name}, quantity={quantity}, sector={sector}") # Debugging line
281
  if sector not in st.session_state['stocks'] or stock_name not in st.session_state['stocks'][sector]: # ์„นํ„ฐ ์ •๋ณด๋กœ ํ™•์ธ
282
  st.session_state['messages'].append({"type": "error", "text": "์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ฃผ์‹ ์ข…๋ชฉ์ž…๋‹ˆ๋‹ค."})
283
  return
 
487
  st.info("๋ณด์œ  ์ฃผ์‹์ด ์—†์Šต๋‹ˆ๋‹ค.")
488
 
489
 
490
+
491
  # --- ๋ฉ”์ธ ํ™”๋ฉด ---
492
  def main():
493
  col_news, col_main_ui = st.columns([1, 2])
 
618
  st.info(f"**{selected_stock_buy}** ํ˜„์žฌ ์ฃผ๊ฐ€: {stock_price_buy:,.0f}์›") # info box ์‚ฌ์šฉ
619
  quantity_buy = st.number_input("๋งค์ˆ˜ ์ˆ˜๋Ÿ‰ (์ฃผ):", min_value=1, value=1, step=1) # Label ์ถ”๊ฐ€
620
  if st.button("์ฃผ์‹ ๋งค์ˆ˜", use_container_width=True): # ๋ฒ„ํŠผ ํ…์ŠคํŠธ ๋ณ€๊ฒฝ
621
+ st.write(f"Button '์ฃผ์‹ ๋งค์ˆ˜' clicked. Calling buy_stock with: stock_name={selected_stock_buy}, quantity={quantity_buy}, sector={selected_sector_buy}") # Debugging line
622
  buy_stock(selected_stock_buy, quantity_buy, selected_sector_buy)
623
 
624
  elif menu == '์ฃผ์‹ ๋งค๋„':