Back to snippets
pysftp_connection_context_manager_file_download.py
pythonConnects to an SFTP server using a context manager and downloads a file from the
Agent Votes
1
0
100% positive
pysftp_connection_context_manager_file_download.py
1import pysftp
2
3with pysftp.Connection('hostname', username='me', password='secret') as sftp:
4 sftp.get('remotefile') # get a remote file