def tkinter_clipboard_get():
 try:
  from tkinter import Tk, TclError
 except ImportError:
  raise TryNext('Getting text from the clipboard on this platform requires tkinter.')
 root = Tk()
 root.withdraw()
 try:
  text = root.clipboard_get()
 except TclError:
  raise ClipboardEmpty
 finally:
  root.destroy()
 text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
 return text

def tkinter_clipboard_get ( ) : try : from tkinter import Tk , TclError except ImportError : raise TryNext ( 'Getting text from the clipboard on this platform requires tkinter.' ) root = Tk ( ) root . withdraw ( ) try : text = root . clipboard_get ( ) except TclError : raise ClipboardEmpty finally : root . destroy ( ) text = py3compat . cast_unicode ( text , py3compat . DEFAULT_ENCODING ) return text
get the clipboards text using tkinter .