VB/win32com data passing question - be gentle!

Matthew Cincera r14382 at email.sps.mot.com
Fri Jun 25 23:30:02 CEST 1999


Hello,

I am not really experienced with win32com so hold your laughter to
a minimum if this is a stupid question.  I have a python socket
based system to which I created a com server where I can execute
methods on the main system.  Basically the com server is a 'wrapper'
which does everything in python, but accepts strings as input from
VB, and all replies are converted to strings and parsed in VB.
We are having performance problems since the returned python objects
are large and the repr() function is taking ~9 seconds on large
transactions.  My questions are:

1. Is there an easy way to convert python datatypes into ones
   VB can use.  The datatypes can be nested, for example:

   reply = [ [1, { this is data } ], [2, { this is more data }]]

   The replys can be rather large.  I do not reply anything
   but python datatypes, so I only need to handle numbers, strings,
   dictionaries, lists and the like.  Currently, I convert the
   reply to a string and return that to VB.  Then my VB program
   re-parses the string into the individual elements.  This is
   obviously not efficient but does work.

2. If I can't do 1), does anyone know of a more efficient way
   to do repr()?

Thanks in advance for any insights.

Regards,

Matt





More information about the Python-list mailing list