-1

so, I read from DB binary field i.e. 'field1' to var Buf1, and then do something like:

unpack_from('I', Buf1, 0)

so, all is ok. but question is how can I ini Buf1 without going to DB? I can get value from DB manually and init my var statically, but how? in DB field 'field1' I see something like '0x7B0500000100000064000000B80100006'. and how can I init valid binary buffer from it?

4

1 回答 1

0

只需使用 pack 或者pack_into它是 python 的 unpack_from 的对立面。

另请参阅那个答案

但是您应该详细说明您的问题并提供更多示例代码。您说从字段中看到的值太大而无法将其读入整数。我想知道你是否得到了完整的价值。

于 2010-06-26T01:08:54.620 回答