[Tutor] Help with building bytearray arrays
Peter Otten
__peter__ at web.de
Tue Sep 11 03:16:11 EDT 2018
Chip Wachob wrote:
> Peter,
>
> I see that clue "[[".
>
> The thread history pretty much sums up what is going on up to this point.
>
> I'll cover it once more:
[snip]
> I hope this helps.
Unfortunately it doesn't as the problem is in my_transfer.
> I'm beginning to wonder if Python was the right choice for this
> project..
You mean you'd rather debug a segfault in C than an exception with a
traceback and an error message that is spot on in Python?
You have an error in your program logic, and you'll eventually run into
those no matter what language you choose.
> Thanks to everyone for your comments and patience.
If you are too frustrated to look into the actual problem at the moment you
can change the following loop
> Earlier discussions here indicated that the best way was to :
>
> results = []
>
> for i in range (0, slice_size):
> results.append(transfer(data_out))
by replacing the append() with the extend() method
results = []
for i in range (0, slice_size):
results.extend(transfer(data_out))
for now.
More information about the Tutor
mailing list