View Single Post
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#2
Code:
import threading
import gtk
import time

class Clipboard(threading.Thread):
   def __init__(self):
      threading.Thread.__init__(self)

   def run(self):
      while(True): # Forever loop
         self.clip = self.get_clipboard()
         time.sleep(2)
      
   def get_clipboard(self):
      clip = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)
      print 1
      text = clip.request_text(self.get_text)
      
   def get_text(self, clipboard, text):
      print 2
      print text
      
Clipboard().start()
 

The Following User Says Thank You to attila77 For This Useful Post: