python – 在pysftp get中指定文件模式
发布时间:2020-05-23 10:56:11 所属栏目:Python 来源:互联网
导读:我们可以写一个简单的得到这样的: import pysftphostname = somehostuser = bob password = 123456 filename = somefile.txtwith pysftp.Connection(hostname, username=user, private_key=/home/private_ke
|
我们可以写一个简单的得到这样的: import pysftp
hostname = "somehost"
user = "bob"
password = "123456"
filename = 'somefile.txt'
with pysftp.Connection(hostname,username=user,private_key='/home/private_key_file') as sftp:
sftp.get(filename)
但是,我想在文件名中指定一个模式,例如:’* .txt’ 有关如何使用pysftp执行此操作的任何想法? 解决方法在pysftp中没有下载与文件掩码匹配的文件的功能.你必须: >使用 有关灵感,请参阅如何实现 有关简单实现,请参阅List files on SFTP server matching wildcard in Python using Paramiko.有关递归示例,请参阅Python pysftp get_r from Linux works fine on Linux but not on Windows. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
