Bug in struct module?

Hoon Yoon hyoon at bigfoot.com
Mon Aug 16 22:33:32 CEST 1999


Hi,


>>> calcsize('hd')
16
>>> calcsize('dh')
10
That seems like a bug to me. BTW: it won't convert 
>>> unpack('dh', s[-10:])
(2.47032822921e-323, 16424)
>>> unpack('hd', s[-10:])
Traceback (innermost last):
  File "<stdin>", line 1, in ?
struct.error: unpack str size does not match format

Does anyone know how to unpack a bin file written in VB:
Fno = FreeFile
Open CDir & Fn & "." & cdte For Binary As #Fno
Put #Fno, , xMat

where xMat is same as x created by?

Dim x(4, 3) As Double
'This code example opens the file in Binary mode for reading; other
processes can't read file.
For r = 0 To UBound(x, 1)
    For c = 0 To UBound(x, 2)
        x(r, c) = r * c
    Next c
Next r

-- 
*****************************************************************************
S. Hoon Yoon (Quant) Merrill Lynch Equity Trading, 
yelled at yahoo.com hoon at bigfoot.com(w)
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages."    Mauldin
*****************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcard.vcf
Type: text/x-vcard
Size: 202 bytes
Desc: Card for Hoon Yoon
URL: <http://mail.python.org/pipermail/python-list/attachments/19990816/82b8226a/attachment.vcf>


More information about the Python-list mailing list