views:

102

answers:

3

I want my Python script to be able to copy and paste to/from the clipboard via x11 (so that it will work on Linux). Can anyone point me to specific resources I can look at, or the concepts I would have to master?

Is this possible to do with the Python X library at http://python-xlib.sourceforge.net ?

A: 

you might find this thread useful: How does X11 clipboard handle multiple data formats?

mykhal
A: 

You can do this with pygtk. A clean solution but might be a bit overkill depending on your application.

Another method that gets some google-hits is to make a system call to xsel.

Mark
+2  A: 

I favor a Tkinter-based solution over one which requires pygtk, simply because of the potential the latter has for installation challenges. Given this, my recommendation to Alvin Smith is to read:

Cameron Laird