MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / get

Method get

PySimpleGUI/PySimpleGUI.py:22844–22873  ·  view source on GitHub ↗

Returns the value of a specified setting. If the setting is not found in the settings dictionary, then the user specified default value will be returned. It no default is specified and nothing is found, then the "default value" is returned. This default can be specified i

(self, key, default=None)

Source from the content-addressed store, hash-verified

22842 return value
22843
22844 def get(self, key, default=None):
22845 """
22846 Returns the value of a specified setting. If the setting is not found in the settings dictionary, then
22847 the user specified default value will be returned. It no default is specified and nothing is found, then
22848 the "default value" is returned. This default can be specified in this call, or previously defined
22849 by calling set_default. If nothing specified now or previously, then None is returned as default.
22850
22851 :param key: Key used to lookup the setting in the settings dictionary
22852 :type key: (Any)
22853 :param default: Value to use should the key not be found in the dictionary
22854 :type default: (Any)
22855 :return: Value of specified settings
22856 :rtype: (Any)
22857 """
22858 if self.default_value is not None:
22859 default = self.default_value
22860
22861 if self.full_filename is None:
22862 self.set_location()
22863 if self.autosave or self.dict == {}:
22864 self.read()
22865 if not self.use_config_file:
22866 value = self.dict.get(key, default)
22867 else:
22868 value = self.section_class_dict.get(key, None)
22869 if key not in list(self.section_class_dict.keys()):
22870 self.section_class_dict[key] = self._SectionDict(key, {}, self.config, self)
22871 value = self.section_class_dict[key]
22872 value.new_section = True
22873 return value
22874
22875 def get_dict(self):
22876 """

Callers 7

mainFunction · 0.95
popup_get_folderFunction · 0.95
popup_get_fileFunction · 0.95
popup_get_textFunction · 0.95
delete_entryMethod · 0.95
__getitem__Method · 0.95
__delitem__Method · 0.95

Calls 3

set_locationMethod · 0.95
readMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected