1import pysftp
2import sys
3
4path = './THETARGETDIRECTORY/' + sys.argv[1] #hard-coded
5localpath = sys.argv[1]
6
7host = "THEHOST.com" #hard-coded
8password = "THEPASSWORD" #hard-coded
9username = "THEUSERNAME" #hard-coded
10
11with pysftp.Connection(host, username=username, password=password) as sftp:
12 sftp.put(localpath, path)
13
14print 'Upload done.'