MCPcopy Index your code
hub / github.com/python/cpython / clipboard_get

Method clipboard_get

Lib/tkinter/__init__.py:1018–1039  ·  view source on GitHub ↗

Retrieve data from the clipboard on window's display. The window keyword defaults to the root window of the Tkinter application. The type keyword specifies the form in which the data is to be returned and should be an atom name such as STRING or FILE_NAME.

(self, **kw)

Source from the content-addressed store, hash-verified

1016
1017 # Clipboard handling:
1018 def clipboard_get(self, **kw):
1019 """Retrieve data from the clipboard on window's display.
1020
1021 The window keyword defaults to the root window of the Tkinter
1022 application.
1023
1024 The type keyword specifies the form in which the data is
1025 to be returned and should be an atom name such as STRING
1026 or FILE_NAME. Type defaults to STRING, except on X11, where the default
1027 is to try UTF8_STRING and fall back to STRING.
1028
1029 This command is equivalent to:
1030
1031 selection_get(CLIPBOARD)
1032 """
1033 if 'type' not in kw and self._windowingsystem == 'x11':
1034 try:
1035 kw['type'] = 'UTF8_STRING'
1036 return self.tk.call(('clipboard', 'get') + self._options(kw))
1037 except TclError:
1038 del kw['type']
1039 return self.tk.call(('clipboard', 'get') + self._options(kw))
1040
1041 def clipboard_clear(self, **kw):
1042 """Clear the data in the Tk clipboard.

Callers 4

test_clipboardMethod · 0.80
test_clipboard_astralMethod · 0.80
test_copyMethod · 0.80

Calls 2

_optionsMethod · 0.95
callMethod · 0.45

Tested by 4

test_clipboardMethod · 0.64
test_clipboard_astralMethod · 0.64
test_copyMethod · 0.64