paulwong

          python界面庫

          python服務器腳本,生成html,無需寫js,css,適合AI項目
          https://cheat-sheet.streamlit.app

          生成文字的代碼:
          st.text('Fixed width text')
          st.markdown('_Markdown_'# see #*
          st.caption('Balloons. Hundreds of them')
          st.latex(r''' e^{i\pi} + 1 = 0 ''')
          st.write('Most objects'# df, err, func, keras!
          st.write(['st''is <', 3]) # see *
          st.title('My title')
          st.header('My header')
          st.subheader('My sub')
          st.code('for i in range(8): foo()')

          # * optional kwarg unsafe_allow_html = True

          生成form控件:
          st.button('Hit me')
          st.data_editor('Edit data', data)
          st.checkbox('Check me out')
          st.radio('Pick one:', ['nose','ear'])
          st.selectbox('Select', [1,2,3])
          st.multiselect('Multiselect', [1,2,3])
          st.slider('Slide me', min_value=0, max_value=10)
          st.select_slider('Slide to select', options=[1,'2'])
          st.text_input('Enter some text')
          st.number_input('Enter a number')
          st.text_area('Area for textual entry')
          st.date_input('Date input')
          st.time_input('Time entry')
          st.file_uploader('File uploader')
          st.download_button('On the dl', data)
          st.camera_input("一二三,茄子!")
          st.color_picker('Pick a color')

          用表格顯示數據:
          st.dataframe(my_dataframe)
          st.table(data.iloc[0:10])
          st.json({'foo':'bar','fu':'ba'})
          st.metric(label="Temp", value="273 K", delta="1.2 K")


          顯示加載進度條與狀態:
          # Show a spinner during a process
          >>> with st.spinner(text='In progress'):
          >>>   time.sleep(3)
          >>>   st.success('Done')

          # Show and update progress bar
          >>> bar = st.progress(50)
          >>> time.sleep(3)
          >>> bar.progress(100)

          st.balloons()
          st.snow()
          st.toast('Mr Stay-Puft')
          st.error('Error message')
          st.warning('Warning message')
          st.info('Info message')
          st.success('Success message')
          st.exception(e)


          posted on 2024-08-12 15:19 paulwong 閱讀(92) 評論(0)  編輯  收藏 所屬分類: AI-PYTHON


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 大理市| 定襄县| 黄大仙区| 龙陵县| 义马市| 商水县| 蚌埠市| 北辰区| 芜湖市| 登封市| 甘谷县| 奉化市| 达拉特旗| 萨迦县| 云安县| 伊宁县| 琼中| 云龙县| 石首市| 邢台市| 岑溪市| 荣昌县| 福建省| 马山县| 宿州市| 吴旗县| 沁阳市| 临夏市| 黔西县| 北宁市| 平利县| 镇江市| 阳江市| 沛县| 西华县| 南江县| 新龙县| 蒙自县| 嘉峪关市| 孝义市| 乌审旗|