不多说,我们直接上源码: # -*- coding:UTF-8 -*- ''' 实现文件打包、上传与校验 Created on 2018年1月12日 @author: liuyazhuang ''' from fabric.api import * from fabric.context_managers import * from fabric.contrib.console import confirm env.user = 'root' env.hosts = ['10.2.2.2'] env.password = 'cardio-2017' @task @runs_once def