def set_clipboard(text):
 if (not text):
  return
 clipboard = QtWidgets.QApplication.clipboard()
 clipboard.setText(text, QtGui.QClipboard.Clipboard)
 clipboard.setText(text, QtGui.QClipboard.Selection)
 persist_clipboard()

def set_clipboard ( text ) : if ( not text ) : return clipboard = QtWidgets . QApplication . clipboard ( ) clipboard . setText ( text , QtGui . QClipboard . Clipboard ) clipboard . setText ( text , QtGui . QClipboard . Selection ) persist_clipboard ( )
sets the copy/paste buffer to text .