import paramiko, os
paramiko.util.log_to_file(\'E:\\Automation\\paramiko.log\')
from stat import S_ISDIR
host = \"xx.xx.xxx.xxx\"
port = 22
transport = paramiko.Tran
The second argument to SFTPClient.get is a path to a local file. While you seem to pass a path to a directory.
Also, you should not use os.path.join
on SFTP paths. os.path.join
is for local paths. SFTP always uses forward slashes, while os.path.join
uses local OS-specific separators (back slashes on Windows).
sftp.get(path + '/' + file, os.path.join('E:\InsightImport\CSV_EXTRACT', file))