On Mon, Oct 28, 2013 at 6:52 AM, Dave Cook <dav...@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
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32