January 25th, 2013, 02:14 AM
SFTP using paramiko
Hey, i am using sftp to collect files from other server using paramiko. But the problem is that i have to get certain specific types of files . So i am using mask in my xml. But i don't know which function to use get the files . How to use listdir or any other function to get specific files matching the xml.
January 25th, 2013, 09:03 AM
I hope one of these concepts helps. Looks like you'd need to combine with xml reader.
>>> import os, re, glob
>>> files = os.listdir(os.curdir)
>>> select_files = [f for f in files if re.search('expression',f)]
>>> # or
>>> files = glob.glob('*.txt')
[/code] are essential for python code and Makefiles!