Desi Founder @ Work

Posts Tagged ‘debugging

16 Feb, 2009

Python: Copy to clipboard

Posted by: sharjeel In: Programming

I use this small utility function for debugging certain Python scripts, especially those for processing data, e.g. moving some bits of information to Excel.
The idea is pretty simple. Just pass it some information and it’ll be available in your clipboard.
 
import sys
import win32clipboard as wc
import win32con
 
def copy_to_clipboard(msg):
if sys.platform == ‘win32′:
[...]