Hey All. All I need to do in this script is scp or sftp a bunch of files to a remote server. This script will run from a cron job eventually.
For whatever reason, paramiko can't cope with a list. --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/msh/<ipython console> in <module>() AttributeError: 'NoneType' object has no attribute 'put' In [18]: type localpath -------> type(localpath) Out[18]: <type 'list'> In [19]: for each in localpath ------------------------------------------------------------ ------ script begins ------------ import paramiko import glob import os paramiko.util.log_to_file('/tmp/paramiko.log') host = "sftp.okcomputer.yo" port = 22 transport = paramiko.Transport((host, port)) password = "T0pS3kr1t!" username = "schizznits" transport.connect(username = username, password = password) sftp = paramiko.SFTPClient.from_transport(transport) os.chdir("/home/fatcat/") filepath = '/' localpath = glob.glob("*.tab") sftp.put(localpath, filepath) sftp.close() transport.close() --- script ends ------ -- I fear you speak upon the rack, Where men enforced do speak anything. - William Shakespeare _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor