簡體   English   中英

單擊streamlit上的按鈕后是否可以保存文本?

[英]Is it possible to save a text after clicking a button on streamlit?

我有

b0 = st.button("Hi There", key=0)
        if b0:
            st.write("gratitude word")

是否可以保存單擊 b0 的 output? 所以基本上將“感謝詞”保存為 CSV,命名為 file_one.csv

b0 = st.button("Hi There", key=0)
    if b0:
        st.write("gratitude word")
        with open("file.csv", "w") as f:
            print("xxx", file=f)

做這項工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM