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.

popup_get_file(
    message,
    title = None,
    default_path = "",
    default_extension = "",
    save_as = False,
    file_types = (('ALL Files', '*'),),
    no_window = False,
    size = (None, None),
    button_color = None,
    background_color = None,
    text_color = None,
    icon = ...,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = False,
    location = (None, None),
    initial_folder = None,
    image = 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", ". *"),).
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)
icon bytes or str b'iVBORw0KGgoAAAANSUhEUgAAAEAAAAA4CAYAAABNGP5yAAAQFklEQVR4nLWba5RkVXXHf/uce6urqh8DCMGV4FsgMszDYAxqspgxAZkBedo1ibCECDoxRlfQLBUdproaCCCKrpj4iAGJixVIdUAQZsYHZgaXwUAcZXqGwRBjjBENiMP0o973nJ0Pt7q7urpuPQayP3TXvffcc/b/f87ZZ5+9zxVeAFEdtyJTbvF635oTyAZpylGVRuqQvG5vuVO5LiIUi4ZcLi6b3zlGyBkovwecjMqvI2pAHkPlfraffS8AxaJdfKdPkUEKt4vmMUygIqg+tvYVZOSPUc7C6auBFIY6Rp7F6Z2Y8G/kN/c+q0Ws5EhWMp83FAoegOt3roXwXWh0DmJfQZgCr6DxY4wB58DrQ7joavKbvkteDQVRQP9fCWjtTX1i3ccI5UNkzBh1hYaPmxcBCwwZqPpfUPcfkVOmv6yKgZi4ZZWOFy1TOcd4PsXaN3wAa/MMZdPUKxDVFcSDSovaiqohPSxEdYePrmbbpptj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BMTQiF3iFJlM43qEwyNBC/cSIB4xzgaUK88QqOyiRtyv0R16VuEpiSsAu3H2/qR5LLGdDjRUSh4xouWGy/6FXW/mUb1cdIjAbpwRPYIQ+3x1xRxz9fK93C4fCaFC35OXg0iK/RIWgYPE+kL4A8AinrRzhGWqZyLU1WbfkJ97mwa1X8j2zwnrP1kp5YNd0W9IwgNmZGAWvnLNB4e5+YL5tpPh7bKcld4Yipu1KUeJ2qUCWSISNsORQ+QCInjMWKMeTqxzCIJF/+M/FfOAj5PZmxL7Oa6CLAkpoW0CRyPMZbMiKVePki5fC3b33IXqJAnETydkKjmjUjB6xPrPslx4Qd4tgEOT/ejGZ0MsDJkAiItY806OfEHP9I8RgoJJ7xavxWa/NoHseZahrIZaiXwzi9XV4mzqioYaxgahnqljHe30PA3U9g829wdLhTuqnYbAc17e86wHH/4k4RcgpEXEXaN/Ky8FPB1nTcNf7m8Zvru5hG87sHGhSknokzuOpnAvg+vlxKkVsVh9ZaPpRYYb9RmEPMVXOMWtp+zHxjo67HeIZ0n15yA2t+vRfqS+TlnwMtK07EQe1z6nUqb+qg1O2XNY/u69nwnaQUw+Y0TMXomIhvw7uUoIcLPUfkvjExjoj189Jwn4/fUMo7v9Z1Qq/wf9GqvpKr/2kkAAAAASUVORK5CYII=' 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 False 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
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
save_as bool False if True, the "save as" dialog is shown which will verify before overwriting
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