Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1453

Python • How to handle bytearray from NFC Tag Reader

$
0
0
Hello everyone. I'm trying to work with NFC Tags and where able to read not only the UID from the NFC tag but also the data. I get it as a bytearray and don't find a solution, how I would work with it. Seems like I don't really understand bytearrays so far. :?

This:

Code:

data = pn532.mifare_classic_read_block(4)print(data)
Does result in the following output:

Code:

bytearray(b'\x03\x0c\xd1\x01\x08T\x02enOmega\xfe\x00')
The data I actually want to work with is ...\x02enOmega\...

What would be a proper way to get this data value only from the Tag or at least to "convert" the bytearray to a list where I can access this value only?

Statistics: Posted by Tetrikus — Thu Dec 19, 2024 7:40 am



Viewing all articles
Browse latest Browse all 1453

Trending Articles