Web Analytics Made Easy - Statcounter
Skip to content

Popup get file

Display popup window with text entry field and browse button so that a file can be chosen by user.

    title = None,
    default_path = "",
    default_extension = "",
    save_as = False,
    multiple_files = False,
    file_types = (('ALL Files', '*.* *'),),
    no_window = False,
    size = (None, None),
    button_color = None,
    background_color = None,
    text_color = None,
    icon = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    initial_folder = None,
    image = None,
    files_delimiter = ";",
    modal = True,
    history = False,
    show_hidden = True,
    history_setting_filename = None

Parameter Descriptions

Name Type Default Description
background_color str None background color of the entire window
button_color (str, str) or str None Color of the button (text, background)
default_extension str If no extension entered by user, add this to filename (only used in saveas dialogs)
default_path str path to display to user as starting point (filled into the input field)
file_types Tuple[Tuple[str,str]] (('ALL Files', '. *'),) List of extensions to show using wildcards. All files (the default) = (("ALL Files", ". *"),).
files_delimiter str ; String to place between files when multiple files are selected. Normally a ;
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
history bool False If True then enable a "history" feature that will display previous entries used. Uses settings filename provided or default if none provided
history_setting_filename str None Filename to use for the User Settings. Will store list of previous entries in this settings file
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
initial_folder str None location in filesystem to begin browsing
keep_on_top bool None If True the window will remain above all current windows
location (int, int) (None, None) Location of upper left corner of the window
message str message displayed to user
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
multiple_files bool False if True, then allows multiple files to be selected that are returned with ';' between each filename
no_titlebar bool False If True no titlebar will be shown
no_window bool False if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
save_as bool False if True, the "save as" dialog is shown which will verify before overwriting
show_hidden bool True If True then enables the checkbox in the system dialog to select hidden files to be shown
size (int, int) (None, None) (width, height) of the InputText Element or Combo element if using history feature
text_color str None color of the text
title str None Window title
RETURN str or None string representing the file(s) chosen, None if cancelled or window closed with X