Dynamic copy/paste using DDE with Python on Windows

Eric Brunel eric.brunel at pragmadev.com
Mon Oct 14 11:48:57 CEST 2002

Hi all,

We'd like to add to a Windows application the possibility to make dynamic 
copy/paste: the user selects something in the application, pastes it 
elsewhere (e.g. Word...), and whenever the source is modified, the changes 
are automatically forwarded to the copy.

AFAIK, the way to do that on Windows is DDE. But I can't find anywhere a 
simple sample code showing how to do that.

To understand exactly what's going on in DDE, I'd like to do something 
really simple, for example having a single text file available via a DDE 
server: I would run the server, paste the text file as a DDE object in Word 
for example, and then everytime the text file changes, I want the changes 
forwarded to Word automatically. So no need for fancy GUI, or whatever: 
just a plain simple command line DDE server and nothing else.

I've browsed the MSDN, looked at the examples in the win32 distribution 
(demos/dde/*), googled for sample code, but I didn't find anything really 
usable and I still don't understand how to do it.

Could someone point me to some usefull resources or send me some sample 
code? TIA
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

More information about the Python-list mailing list