title: Is there a solution to return the selected file type (not only the file list) from askopenfilenames in Tkinter?
body: <p>Python (Tkinter) <code>filedialog.askopenfilenames</code> dialog window returns only a tuple of selected files by default. However, for parsing different files I would need which file case was selected by the user.</p>
  <p>For example, the user can select from the dialog window: <code>(&quot;Regular csv files&quot;,&quot;*.csv&quot;),(&quot;Measurement csv files&quot;,&quot;*.csv&quot;)</code>. After selecting file(s), I would need an additional output argument (besides files tuple), that gives me, that the user selected <code>&quot;Measurement csv files&quot;</code> and not the regular csv, so after that I can decide what parser to use to read that type of csv file.</p>
  <p>I know, that I can get the file extension from the files tuple, but in this case that does not tell me which csv case was selected. Something like the following would be fine (like in Matlab):</p>
  <pre><code>filepath, selected_case = filedialog.askopenfilenames(title='Select data file',
                                                        filetypes=(
                                                            (&quot;Measurement csv files&quot;, &quot;*.csv&quot;),
                                                            (&quot;csv files&quot;, &quot;*.csv&quot;),
                                                            (&quot;xls files&quot;, &quot;*.xlsx&quot;),
                                                            (&quot;xls files&quot;, &quot;*.xls&quot;),
                                                            ))
  </code></pre>