streamlit web框架

cooolr 于 2021-09-16 发布
pip install streamlit

# test.py
import os
import streamlit as st

def run(command):
    res = os.popen(f"ssh root@192.168.1.158 '{command}'").read().strip()
    return res

st.title("命令执行工具")

command = st.text_input(label='命令')

if st.button("执行"):
    result = run(command)
    st.write(result)
streamlit run test.py