Using PythonWin32 to copy text to Windoze Clipboard for Unix-stylerandom .sig rotator?

Ryan Ginstrom ginstrom at tree.odn.ne.jp
Thu Apr 6 06:15:31 EDT 2006


> On 
> Behalf Of dananrg at yahoo.com
> I want to write a Python script that, when launched, will choose a
> random .sig (from a list of about 30 cool ones I've devised), 
> and store
> the .sig text in the Windows Clipboard, so I can then paste 
> it into any
> Windows application.

You might try looking into wxPython.wx.wxTheClipboard

However, unless this is soley for your own use, I would suggest you try a
different method. In my experience, users get annoyed when their clipboard
contents are stepped on.

One general, if messy, solution is to use pywinauto to type the text in
directly. 

Another (much more ambitious) project would be to create a private clipboard,
save the current clipboard contents there, and then swap them back in when
you are done.

Regards,
Ryan

---
Ryan Ginstrom




More information about the Python-list mailing list