Mailing List Archive

Using the Windows clipboard in Python
This is a preliminary version of a module which lets you exchange data via
the Windows clipboard, either as a string or as a 2D array. For example,
this lets you copy and paste data between Python programs and Excel.

ftp://ftp.mindspring.com/users/doctorwes/clipboard.py

It uses the Win32 extensions and Sam Rushing's calldll module. There must be
an easier way - I'm a Windows novice, so suggestions are very welcome.

If you use this module (or calldll generally) you may notice mysterious but
apparently harmless errors when exiting Python; something to do with
libraries not unloading. If you know why this happens, please tell me!
Using the Windows clipboard in Python [ In reply to ]
Small modification: removed 'import win32con' as all I needed were two
constants. So the Win32 extensions are no longer required. Also, added the
ability to read/write NumPy arrays (via theclipboard.array attribute).

Wesley Phoa wrote in message <7jik35$esd$1@nntp6.atl.mindspring.net>...
>This is a preliminary version of a module which lets you exchange data via
>the Windows clipboard, either as a string or as a 2D array. For example,
>this lets you copy and paste data between Python programs and Excel.