Python 3.7.4 Idle 3.7 32-bit
I am attempting to connect to an SFTP and download a .CSV file to a local network drive. When I run my code, I get no error message, but nothing prints in the shell and nothing is being downloaded to my local directory.
import pysftp
import time
def SFTP_Get_File():
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
host='ServerName'
user='FakeUser'
pw='FakePassword'
with pysftp.Connection(host,
username=user,
password=pw,
cnopts = cnopts
) as sftp:
print("Connection succesfully stablished ... ")
sftp.get('/upload/File_Name.csv', r'Local_File_Name.csv')
time.sleep(2)
sftp.close()
Expected Results is I get a print of connection success and the file in the SFTP downloads to my local directory.
Actual Results. Nothing happens.