title: Isolating file names from paths in python
body: <p>I am trying to isolate file names from paths imported using &quot;filedialog.askopenfilenames&quot;. I am doing that so I can use them later in plots.</p>
  <p>Let us say for example that I imported three excel files that have the following names:
  &quot;sample_excel_1&quot;,&quot;sample_excel_2.xlsx&quot;,&quot;sample_excel_3.xlsx&quot;</p>
  <p>The output in my case is the full paths of the files( i.e.,  ('//tudelft.net/staff-homes/K/mkhadijeh/Desktop/Python/sample_excel_1.xlsx', '//tudelft.net/staff-homes/K/mkhadijeh/Desktop/Python/sample_excel_2.xlsx', '//tudelft.net/staff-homes/K/mkhadijeh/Desktop/Python/sample_excel_3.xlsx') )</p>
  <p>I would like the outputs to be instead <strong>(&quot;sample_excel_1&quot;,&quot;sample_excel_2.xlsx&quot;,&quot;sample_excel_3.xlsx&quot;)</strong></p>
  <p>Any help!</p>
  <p>The code is below:</p>
  <pre><code>import tkinter
  from tkinter import *
  from tkinter import filedialog
  import numpy as np
  
  
  filename = filedialog.askopenfilenames(initialdir=&quot;c:/&quot;, title=&quot;Selecte a file&quot;, filetypes=((&quot;Excel files&quot;, &quot;*.xlsx&quot;),(&quot;All files&quot;,&quot;*.*&quot;)))
  
  a = filename
  print(a)
  </code></pre>
  <p>I want a to be a list so I can easily access it later (i.e.,  [&quot;sample_excel_1&quot;,&quot;sample_excel_2.xlsx&quot;,&quot;sample_excel_3.xlsx&quot;]
  )</p>