reading from serial port I get once a time lines of four types, let's call those A, B, C & D and put those values into accordion queue:
now I have to write something like this:
while readfromserial:
if A: put A in queue1
elif B: save B
elif C:
B += C
put B in queue1
B=""
else: put in queue2
Whic is the best "Pythonic" way to do this?