使用python远程执行shell脚本 [英] shell script remote execution using python

查看:41
本文介绍了使用python远程执行shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Windows 上使用 Python 来执行位于远程 Unix 机器上的 shell 脚本?

Is there a way that I can use Python on Windows to execute shell scripts which are located on a remote Unix machine?

P.S:抱歉编辑晚了.我确实知道 Paramiko,但我想知道没有它是否有办法做到这一点.首先,可以用 subprocess() 来完成吗?

P.S: Sorry about the late edit. I do know of Paramiko, but I wanted to know if there is way of doing it without it. For starters, could it be done with subprocess()?

推荐答案

python 中没有任何用于远程 shell 执行的包含电池"模块.我建议查看 Fabric ,它提供了一个非常好的界面,可以在远程机器上通过 SSH 工作,可能比paramiko好一点.您甚至可以在 Windows 上安装 Fabric...

There is not any 'batteries included' module for remote shell execution in python. I'd suggest looking into Fabric , which provides a really nice interface for working through SSH on remote machines, probably a bit nicer than paramiko. You can even install Fabric on windows...

这篇关于使用python远程执行shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆