title: Using wildcards in file names using Python's SCPClient library
body: <p>I want to copy files from remote machine using Python script to my local machine. I only know the extension of the file names so I want to use wildcards to express the file name. </p>
  
  <p>In addition, I want to use the <strong>SCPClient</strong> Python library and not the <strong>os.system</strong> directly as suggested in the question titled <a href="https://stackoverflow.com/questions/23076874/using-wildcards-in-filename-in-scp-in-python">using wildcards in filename in scp in python</a></p>
  
  <p>But when I run the following code:</p>
  
  <pre><code>from paramiko import SSHClient
  import paramiko
  from scp import SCPClient
  
  with SSHClient() as ssh:
      ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
      ssh.connect('10.10.100.5', username= 'root', password='Secret')
      with SCPClient(ssh.get_transport()) as scp:
          scp.get(remote_path='/root/*.py', local_path='.')
  </code></pre>
  
  <p>I get an exception</p>
  
  <blockquote>
    <p>scp.SCPException: scp: /root/*.py: No such file or directory</p>
  </blockquote>
  
  <p>Running from shell works just fine</p>
  
  <blockquote>
    <p>scp root@10.10.100.5:/root/*.py .</p>
  </blockquote>