[Solved] How to access a part of an element from a list?


You need to iterate on the list and retrieve the good properties on each.

values = [[Decoded(data=b'AZ:HP7CXNGSUFEPZCO4GS5RQPY6XY', rect=Rect(left=37, top=152, width=94, height=97))],
          [Decoded(data=b'AZ:9475EFWZCNARPEJEZEMXDFHIBI', rect=Rect(left=32, top=191, width=90, height=88))],
          [Decoded(data=b'AZ:6ECWZUQGEJCR5EZXDH9URCN53M', rect=Rect(left=48, top=183, width=88, height=89))],
          [Decoded(data=b'AZ:XZ9P6KTDGREM5KIXUO9IHCTKAQ', rect=Rect(left=73, top=121, width=91, height=94))]]

datas = [value[0].data for value in values]          # list of encoded string (b'')
datas = [value[0].data.decode() for value in values] # list of strings

6

solved How to access a part of an element from a list?