python + byte array

Peter Hansen peter at engcorp.com
Tue Aug 3 19:03:58 EDT 2004


Ruslan wrote:

> I use win32com package to call WinHTTP COM methods.
> One of them is 'Send'. I can pass string parameter to 'Send' method from
> python - it's OK, but to send binary data i need somehow pass in 'Send'
> method data of _byte array_ type(Visual Basic type). Does anybody know
> how to mimic that 'byte array' type of Visual Basic in Python (i need to
> pass big chunks of binary data in 'Send')?
> I tried struct.pack, but that doesn't seem to be an option.

Strings are probably what you are looking for... in Python a string
is basically an array of bytes.



More information about the Python-list mailing list