Feb-17-2018, 07:56 AM
Hello,
I have got a question.
I'm trying to define a bytearray outside an While: True loop
I have got a question.
I'm trying to define a bytearray outside an While: True loop
while True: byte = bytearray(57) # DataarrayThis works fine, but then I'm losing every cycle the values.
byte = bytearray(57) # Dataarray while True:This only survives the first cycle, second cycle program goes in error
Error: _bytearray[byte_index:2] = _bytes
TypeError: 'NoneType' object does not support item assignment
I've expected the next program to work, but is have the same result.byte = bytearray(57) # Dataarray while True: global byteThanks for a reply