2024-04-29 04:17:08 发布
网友
我正在使用Paramiko的SFTPClient在主机之间传输文件。我希望我的脚本打印文件传输进度类似于使用scp看到的输出。
$ scp my_file user@host user@host password: my_file 100% 816KB 815.8KB/s 00:00 $
知道吗?
提前谢谢
使用put function的可选回调参数。像这样的:
def printTotals(transferred, toBeTransferred): print "Transferred: {0}\tOut of: {1}".format(transferred, toBeTransferred) sftp.put("myfile","myRemoteFile",callback=printTotals)
使用put function的可选回调参数。像这样的:
相关问题 更多 >
编程相关推荐