Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pysftp
- cnopts = pysftp.CnOpts()
- cnopts.hostkeys = None
- srv = pysftp.Connection(host="localhost", username="username",password="password",cnopts=cnopts)
- # Get the directory and file listing
- data = srv.listdir()
- srv.put("input2.txt")
- srv.put("input3.csv")
- srv.put("input4.csv")
- srv.put("input5.csv")
- srv.put("input7.txt")
- srv.get("input8.csv")
- # Closes the connection
- srv.close()
- # Prints out the directories and files, line by line
- for i in data:
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement