title: Getting a filename and save it in a variable in Python
body: <p>I want to get the name of a file that gets created by some other process inside a folder. It's in a path where <strong>only this file</strong> exists. It's in this path:</p>
  
  <pre><code>/directory/which/only/contains/this/one/file/
  </code></pre>
  
  <p>The file's full filename could then be for example:</p>
  
  <pre><code>/directory/which/only/contains/this/one/file/xZqsdtae123456.txt
  </code></pre>
  
  <p>How can I get the name of this file (from the example above: <code>xZqsdtae123456.txt</code>) and then save it in a variable ? </p>