Jen Kris via Python-list schreef op 2/10/2023 om 17:06:
My previous message just went up -- sorry for the mangled formatting. Here it
is properly formatted:
I want to write a list of 64-bit integers to a binary file. Every example I
have seen in my research converts it to .txt, but I want
My previous message just went up -- sorry for the mangled formatting. Here it
is properly formatted:
I want to write a list of 64-bit integers to a binary file. Every example I
have seen in my research converts it to .txt, but I want it in binary. I wrote
this code, based on some earlier wor
Dieter, thanks for your comment that:
* In your code, `offset` is `0`, `1`, `2`, ...
but it should be `0 *8`, `1 * 8`, `2 * 8`, ...
But you concluded with essentially the same solution proposed by MRAB, so that
would obviate the need to write item by item because it writes the whole buffer
at o
Jen Kris wrote at 2023-10-2 00:04 +0200:
>Iwant to write a list of 64-bit integers to a binary file. Everyexample I
>have seen in my research convertsit to .txt, but I want it in binary. I wrote
>this code,based on some earlier work I have done:
>
>buf= bytes((len(qs_array)) * 8)
>
>for offset
Thanks very much, MRAB. I just tried that and it works. What frustrated me is
that every research example I found writes integers as strings. That works --
sort of -- but it requires re-casting each string to integer when reading the
file. If I'm doing binary work I don't want the extra over
On 2023-10-01 23:04, Jen Kris via Python-list wrote:
>
> Iwant to write a list of 64-bit integers to a binary file.
Everyexample I have seen in my research convertsit to .txt, but I want
it in binary. I wrote this code,based on some earlier work I have done:
>
> buf= bytes((len(qs_array)) * 8)
On 2 Oct 2023, at 16:02, Jen Kris via Python-list
wrote:
Iwant to write a list of 64-bit integers to a binary file. Everyexample
I have seen in my research convertsit to .txt, but I want it in binary.
I wrote this code,based on some earlier work I have done:
buf= b
Iwant to write a list of 64-bit integers to a binary file. Everyexample I have
seen in my research convertsit to .txt, but I want it in binary. I wrote this
code,based on some earlier work I have done:
buf= bytes((len(qs_array)) * 8)
foroffset in range(len(qs_array)):
item_to_write= byt