[python-win32] Sending raw bytes with DDE server
Dave Cook
daverz at gmail.com
Mon Oct 28 14:55:51 CET 2013
On Mon, Oct 28, 2013 at 6:52 AM, Dave Cook <daverz at gmail.com> wrote:
> I have to interface some Python code with some ancient DDE clients. One
> of the Requests requires a struct. I tried using the struct.pack from the
> struct module, but data gets cut off at the first inevitable NULL byte.
>
> class MyTopic(object.Object):
>
> def __init__(self, topicName):
> topic = dde.CreateTopic(topicName)
> topic.AddItem(dde.CreateStringItem(""))
> object.Object.__init__(self, topic)
> self.topicName = topicName
>
> def Request(self, req):
> if req=='STATUS':
> vals = range(1, 5)
> result = struct.pack('lffff', *vals)
> return result
>
Sorry, got cut off. Last bit should be as above.
Dave Cook
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20131028/fa4d7474/attachment.html>
More information about the python-win32
mailing list