Hello,
I having a hard time figuring out why this code works in an interactive ipython shell, but it gives a blank clipboard when run in a bash terminal.
Code:
#! /usr/bin/python2.6
#
from gtk import Clipboard
cb = Clipboard()
text = cb.wait_for_text().split('\n')
text = ''.join(text)
cb.set_text(text)
It works if run as ./fix_line_breaks (and of course the shell wrapper I'm using for it)
Code:
#! /bin/bash
#
$HOME/python/fix_line_breaks.py
If I put in a 'print text' at the end, it shows the correct text, it is just not being put into the clipboard from gnome-terminal in X (but it will from the ipython console in gnome-terminal).
However, a paste shows the clipboard to be empty.
Any ideas?
Thanks,
Narnie