当我尝试“获取”我的远程文件时,我得到以下结果。我可以打印并且我知道文件在那里。我需要将文件构建到列表中吗?
file_list_attr = sftp.listdir_attr()
for pfile in file_list_attr:
if DT.datetime.fromtimestamp(pfile.st_mtime) > yesterday:
# print pfile
localfile = path + "\\" + pfile
sftp.get(pfile,localfile)
Traceback (most recent call last):
File "C:\Documents and Settings\tyoffe\Desktop\FTP", line 41, in <module>
localfile = path + "\\" + pfile
TypeError: cannot concatenate 'str' and 'SFTPAttributes' objects