Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-05-03 Thread projetmbc
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 =

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread projetmbc
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

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Giovanni Bajo
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)

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Roberto Alsina
On Monday 27 April 2009 19:22:04 Giovanni Bajo wrote: 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

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Aron Bierbaum
I have not tested on Linux, but it would not surprise me if it was not supported in the same way. -Aron On Mon, Apr 27, 2009 at 5:22 PM, Giovanni Bajo ra...@develer.com wrote: On lun, 2009-04-27 at 18:42 +0200, projetmbc wrote: Thanks a lot, your solution works fine.  :-)  Here is the complete

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-26 Thread projetmbc
sys.exit(app.exec_()) doesn't work. If the clipboard is empty when the program exits, I will do without PyQt so as to have a universal clipboard. Thanks a lot because now I knows how to use clipboard in a real program.. Christophe. Demetrius Cassidy a écrit : The clipboard will empty when

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-26 Thread Aron Bierbaum
We ran into a similar situation where we wanted to ensure that a QPixmap that is copied into the clipboard stays after the application exits. Although as far as I know this should happen automatically when your Qt application exists, we had to do this use the following code manually before exiting

[PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
Hello, here is an example for using the clipboard of Tkinter : from Tkinter import * root = Tk() root.clipboard_clear() root.clipboard_append('A text in the clipboard...') root.withdraw() I would like to do the same with PyQt. Is it possible ?

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread Demetrius Cassidy
from PyQt4.QtGui import QApplication clipboard = QApplication.clipboard() clipboard.setText('mytext') see http://doc.trolltech.com/4.5/qapplication.html projetmbc wrote: Hello, here is an example for using the clipboard of Tkinter : from Tkinter import * root =

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
I've already try that but I have the following message : QWidget: Must construct a QApplication before a QPaintDevice Christophe. Demetrius Cassidy a écrit : from PyQt4.QtGui import QApplication clipboard = QApplication.clipboard() clipboard.setText('mytext') see

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread Darren Dale
Have you tried constructing a QApplication first? On Sat, Apr 25, 2009 at 8:24 PM, projetmbc projet...@club-internet.frwrote: I've already try that but I have the following message : QWidget: Must construct a QApplication before a QPaintDevice Christophe. Demetrius Cassidy a écrit :

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
I've tried the following code but the application never stops because of app.exec_(), and when I close the application, the clipboard is empty. = #!/usr/bin/env python #coding=utf-8 import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) clipboard =