[PyQt] Searching for a very small scprit using CLIPBOARD

projetmbc projetmbc at club-internet.fr
Mon May 4 00:50:39 BST 2009


Giovanni Bajo a écrit :
> On lun, 2009-04-27 at 18:42 +0200, projetmbc wrote:
>   
>> Thanks a lot, your solution works fine.  :-)  Here is the complete 
>> minimal code :
>>
>> ====================================
>> #!/usr/bin/env python
>> #coding=utf-8
>> import sys
>> from PyQt4 import QtGui, QtCore
>> app = QtGui.QApplication(sys.argv)
>> clipboard = app.clipboard()
>> clipboard.setText('The text that must be copied...')
>> event = QtCore.QEvent(QtCore.QEvent.Clipboard)
>> app.sendEvent(clipboard, event)
>> ====================================
>>
>>     
>
> It doesn't work for me on Linux. Should it?
>   
For the moment I do not test it on Linux. It seems that Linux 
distribution does not have necessarly a clipboard utility.

I will try it on Linux and if I find a solution I'll put it here.

Christophe.



More information about the PyQt mailing list