title: How to delete all files in directory on remote SFTP server in Python?
body: <p>I'd like to delete all the files in a given directory on a remote server that I'm already connected to using Paramiko.  I cannot explicitly give the file names, though, because these will vary depending on which version of file I had previously put there.</p>
  
  <p>Here's what I'm trying to do... the line below the #TODO is the call I'm trying where <code>remoteArtifactPath</code> is something like <code>/opt/foo/*</code></p>
  
  <pre><code>ssh = paramiko.SSHClient()
  ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts")))
  ssh.connect(server, username=username, pkey=mykey)
  sftp = ssh.open_sftp()
  
  # TODO: Need to somehow delete all files in remoteArtifactPath remotely
  sftp.remove(remoteArtifactPath+"*")
  
  # Close to end
  sftp.close()
  ssh.close()
  </code></pre>
  
  <p>Any idea how I can achieve this?</p>