MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / clipboard_get

Method clipboard_get

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:905–926  ·  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_

(self, **kw)

Source from the content-addressed store, hash-verified

903
904 # Clipboard handling:
905 def clipboard_get(self, **kw):
906 """Retrieve data from the clipboard on window's display.
907
908 The window keyword defaults to the root window of the Tkinter
909 application.
910
911 The type keyword specifies the form in which the data is
912 to be returned and should be an atom name such as STRING
913 or FILE_NAME. Type defaults to STRING, except on X11, where the default
914 is to try UTF8_STRING and fall back to STRING.
915
916 This command is equivalent to:
917
918 selection_get(CLIPBOARD)
919 """
920 if 'type' not in kw and self._windowingsystem == 'x11':
921 try:
922 kw['type'] = 'UTF8_STRING'
923 return self.tk.call(('clipboard', 'get') + self._options(kw))
924 except TclError:
925 del kw['type']
926 return self.tk.call(('clipboard', 'get') + self._options(kw))
927
928 def clipboard_clear(self, **kw):
929 """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.80

Tested by 4

test_clipboardMethod · 0.64
test_clipboard_astralMethod · 0.64
test_copyMethod · 0.64