MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / FileBrowse

Function FileBrowse

PySimpleGUI/PySimpleGUI.py:13443–13497  ·  view source on GitHub ↗

:param button_text: text in the button (Default value = 'Browse') :type button_text: (str) :param target: key or (row,col) target for the button (Default value = (ThisRow, -1)) :type target: str | (int, int) :param file_types: filter file t

(button_text='Browse', target=(ThisRow, -1), file_types=FILE_TYPES_ALL_FILES, initial_folder=None,
               tooltip=None, size=(None, None), s=(None, None), auto_size_button=None, button_color=None, change_submits=False,
               enable_events=False, font=None, disabled=False,
               pad=None, p=None, key=None, k=None, visible=True, metadata=None, expand_x=False, expand_y=False)

Source from the content-addressed store, hash-verified

13441
13442# ------------------------- FILE BROWSE Element lazy function ------------------------- #
13443def FileBrowse(button_text='Browse', target=(ThisRow, -1), file_types=FILE_TYPES_ALL_FILES, initial_folder=None,
13444 tooltip=None, size=(None, None), s=(None, None), auto_size_button=None, button_color=None, change_submits=False,
13445 enable_events=False, font=None, disabled=False,
13446 pad=None, p=None, key=None, k=None, visible=True, metadata=None, expand_x=False, expand_y=False):
13447 """
13448
13449 :param button_text: text in the button (Default value = 'Browse')
13450 :type button_text: (str)
13451 :param target: key or (row,col) target for the button (Default value = (ThisRow, -1))
13452 :type target: str | (int, int)
13453 :param file_types: filter file types Default value = (("ALL Files", "*.* *"),).
13454 :type file_types: Tuple[(str, str), ...]
13455 :param initial_folder: starting path for folders and files
13456 :type initial_folder:
13457 :param tooltip: text, that will appear when mouse hovers over the element
13458 :type tooltip: (str)
13459 :param size: (w,h) w=characters-wide, h=rows-high
13460 :type size: (int, int)
13461 :param s: Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
13462 :type s: (int, int) | (None, None) | int
13463 :param auto_size_button: True if button size is determined by button text
13464 :type auto_size_button: (bool)
13465 :param button_color: button color (foreground, background)
13466 :type button_color: (str, str) | str
13467 :param change_submits: If True, pressing Enter key submits window (Default = False)
13468 :type change_submits: (bool)
13469 :param enable_events: Turns on the element specific events.(Default = False)
13470 :type enable_events: (bool)
13471 :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
13472 :type font: (str or (str, int[, str]) or None)
13473 :param disabled: set disable state for element (Default = False)
13474 :type disabled: (bool)
13475 :param pad: Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
13476 :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int
13477 :param p: Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
13478 :type p: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int
13479 :param key: key for uniquely identify this element (for window.find_element)
13480 :type key: str | int | tuple | object
13481 :param k: Same as the Key. You can use either k or key. Which ever is set will be used.
13482 :type k: str | int | tuple | object
13483 :param visible: set initial visibility state of the Button
13484 :type visible: (bool)
13485 :param metadata: Anything you want to store along with this button
13486 :type metadata: (Any)
13487 :param expand_x: If True Element will expand in the Horizontal directions
13488 :type expand_x: (bool)
13489 :param expand_y: If True Element will expand in the Vertical directions
13490 :type expand_y: (bool)
13491 :return: returns a button
13492 :rtype: (Button)
13493 """
13494 return Button(button_text=button_text, button_type=BUTTON_TYPE_BROWSE_FILE, target=target, file_types=file_types,
13495 initial_folder=initial_folder, tooltip=tooltip, size=size, s=s, auto_size_button=auto_size_button,
13496 change_submits=change_submits, enable_events=enable_events, disabled=disabled,
13497 button_color=button_color, font=font, pad=pad, p=p, key=key, k=k, visible=visible, metadata=metadata, expand_x=expand_x, expand_y=expand_y)
13498
13499
13500# ------------------------- FILES BROWSE Element (Multiple file selection) lazy function ------------------------- #

Callers 2

popup_get_fileFunction · 0.85

Calls 1

ButtonClass · 0.85

Tested by

no test coverage detected