Update app.py
Browse files
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 == '์ฃผ์ ๋งค๋':
|