Python/PythonWin and DDE?

Gordon McMillan gmcm at hypernet.com
Thu Jul 8 23:15:40 EDT 1999


Karl Putland writes:
> 
> Mark Hammond <MHammond at skippinet.com.au> wrote in message
> news:7m39vq$r5o$1 at m2.c2.telstra-mm.net.au...

> > Yes.  Pythonwin acts as both a client as a server as it communicates between
> > processes.
> 
> Where to start?  Does PythonWin's DDE usage follow that found in M$
> VC++?  If so those docs are weak.  I only have examples in VB and
> VBA.  Where would be the best place to start with PythonWin and DDE?

Here's some code I got working somehow. I think from Pegusas Mail's 
DDE docs, the VB examples:

    server = dde.CreateServer()
    server.Create("ME")  
    conversation = dde.CreateConversation(server)
    try:
        conversation.ConnectTo("WinPMail", "TCP")
    except:
        win32api.WinExec("C:\\PMAIL\\winpm-32.exe -Z 8192")
        conversation.ConnectTo("WinPMail", "TCP")
    try:
        conversation.Poke("TCP", "Get")
    except:
        print curtime(), "Poke failed. Maybe a timeout "  
        time.sleep(600)

- Gordon




More information about the Python-list mailing list