氟橡胶
qaviton-ssh的Python项目详细描述
卡维顿SSH
让ssh超级简单
安装
pip install --upgrade qaviton_ssh
要求
- Python 3.6+
特点
- 简单ssh发送接收api✓
- 异步请求✗(即将推出)
- 多会话工作流✗(即将推出)
使用
创建ssh客户端
^{pr2}$在服务器上创建python脚本
cd='cd myproject'file='script.py'response=client.send_many([cd,f'touch {file}',f'echo "print(\"script success\")" > {file}'])assertnotresponse.error
执行脚本
response=client.send_many([cd,f'python {file}'])assertnotresponse.errorprint(response.data)# server will respond with b'script success'
- 项目
标签: