import paramiko from meutils.pipe import * import streamlit as st host = 'sftp.ai.xm.gov.cn' # 主机 port = 57891 # 端口 sf = paramiko.Transport((host, port)) username = st.text_input('username', 'comp_5154') # 用户名 password = st.text_input('password') # 密码 uploaded_file = st.file_uploader("上传文件") if uploaded_file is not None and password: df = pd.read_csv(uploaded_file, '|', header=0) df.to_csv('result.txt', index=False) sf.connect(username=username, password=password) sftp = paramiko.SFTPClient.from_transport(sf) _ = sftp.put('result.txt', '/result/result.txt') st.write(_) st.write(df)