pyyeti.guitools.askopenfilename¶
- pyyeti.guitools.askopenfilename(title=None, filetypes=None, initialdir=None)[source]¶
Use GUI to select file for reading
- Parameters:
title (string or None) – Title of window. Use None to accept tkinter default.
filetypes (list or None) – Option to limit file search to certain patterns. Typically, this is a list of tuples, each tuple containing a description followed by a pattern (see example below).
initialdir (string or None) – Initial directory to begin search. If None, use previous location if there is one.
- Returns:
filename (string) – The selected filename.
Notes
Here is a simple example:
from pyyeti import guitools filename = guitools.askopenfilename()
To filter the files to selected types:
from pyyeti import guitools filetypes = [('Output4 files', '*.op4'), ('All files', '*')] filename = guitools.askopenfilename(filetypes=filetypes)