st.text_area - 显示多行文本框
streamlit的text_area
方法显示多行文本框。
方法原型
streamlit.text_area(label, value='', key=None)
参数:
- label:组件说明文本,字符串
- value:组件当前文本内容
- key:组件ID
返回值:
text_area
方法返回组件的当前文本内容。
示例代码
>>> txt = st.text_area('Text to analyze', '''
... It was the best of times, it was the worst of times, it was
... the age of wisdom, it was the age of foolishness, it was
... the epoch of belief, it was the epoch of incredulity, it
... was the season of Light, it was the season of Darkness, it
... was the spring of hope, it was the winter of despair, (...)
... ''')
>>> st.write('Sentiment:', run_sentiment_analysis(txt))