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= bytes(qs_array[offset]) struct.pack_into(buf,"<Q", offset, item_to_write) ButI get the error "struct.error: embedded null character." Maybethere's a better way to do this? Anyhelp will be very appreciated. Thanks. -- https://mail.python.org/mailman/listinfo/python-list