I took this code from a youtube video and attempted to edit it to help me
back up a folder on my laptop using sftp
, but I keep getting the following error:
Invalid\x escape.
What can be causing this issue?
Here is my code:
import pysftp as sftp
def sftpExample():
try:
s = sftp.Connection(host='192.168.91.151',username='test',password='password')
remotepath='/home/baar/test'
localpath='C:\Users\xps\Desktop\testme'
s.put(localpath,remotepath)
s.close()#closes the connection
except Exception, e:
print str(e)
sftpExample()