import struct with open('AMY_test_partitions_read.bin', 'rb') as f: data = f.read() seq0 = struct.unpack(' seq1: print("→ app0 is active, new uploads go to app1") else: print("→ app1 is active, new uploads go to app0")