X11 Work Bench Toolkit  1.0
xclip.py
1 import gtk
2 
3 primary = gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY)
4 
5 if primary.wait_is_text_available() :
6  print primary.wait_for_text()
7 
8