def win32_clipboard_get():
 try:
  import win32clipboard
 except ImportError:
  raise TryNext('Getting text from the clipboard requires the pywin32 extensions: http://sourceforge.net/projects/pywin32/')
 win32clipboard.OpenClipboard()
 try:
  text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
 except (TypeError, win32clipboard.error):
  try:
   text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT)
   text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
  except (TypeError, win32clipboard.error):
   raise ClipboardEmpty
 finally:
  win32clipboard.CloseClipboard()
 return text

def win32_clipboard_get ( ) : try : import win32clipboard except ImportError : raise TryNext ( 'Getting text from the clipboard requires the pywin32 extensions: http://sourceforge.net/projects/pywin32/' ) win32clipboard . OpenClipboard ( ) try : text = win32clipboard . GetClipboardData ( win32clipboard . CF_UNICODETEXT ) except ( TypeError , win32clipboard . error ) : try : text = win32clipboard . GetClipboardData ( win32clipboard . CF_TEXT ) text = py3compat . cast_unicode ( text , py3compat . DEFAULT_ENCODING ) except ( TypeError , win32clipboard . error ) : raise ClipboardEmpty finally : win32clipboard . CloseClipboard ( ) return text
get the current clipboards text on windows .