To get the set of expected files with given extensions in a file dialog, I\'ve seen in several places written patterns as (\'label\',\'pattern\'), the pattern b
(\'label\',\'pattern\')
import tkinter options = {} options['defaultextension'] = '.txt' options['filetypes'] = [('all files', '.*'), ('text files', '.txt'),('asc files', '.asc')] options['initialdir'] = '.' file_open = tkinter.filedialog.askopenfile(mode='r', **options)