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

Function clipboard_set

PySimpleGUI/PySimpleGUI.py:20291–20304  ·  view source on GitHub ↗

Sets the clipboard to a specific value. IMPORTANT NOTE - Your PySimpleGUI application needs to remain running until you've pasted your clipboard. This is a tkinter limitation. A workaround was found for Windows, but you still need to stay running for Linux systems. :param new_

(new_value)

Source from the content-addressed store, hash-verified

20289# ...######..########.####.##........########...#######..##.....##.##.....##.########.
20290
20291def clipboard_set(new_value):
20292 """
20293 Sets the clipboard to a specific value.
20294 IMPORTANT NOTE - Your PySimpleGUI application needs to remain running until you've pasted
20295 your clipboard. This is a tkinter limitation. A workaround was found for Windows, but you still
20296 need to stay running for Linux systems.
20297
20298 :param new_value: value to set the clipboard to. Will be converted to a string
20299 :type new_value: (str | bytes)
20300 """
20301 root = _get_hidden_master_root()
20302 root.clipboard_clear()
20303 root.clipboard_append(str(new_value))
20304 root.update()
20305
20306
20307def clipboard_get():

Callers 2

theme_previewer_swatchesFunction · 0.85
main_get_debug_dataFunction · 0.85

Calls 2

_get_hidden_master_rootFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected