Ritu Singh
Problem:
I would like to remove ASCII characters from my bytearray and see it containing hexadecimal numbers. To explain it better: I receive CAN messages from CANbus using the pyton-can library and catch them to store in a message variable. As I print it I see:
But I don't want to see ASCII characters, I want it to print this as for example b'\x00\x00\x01\x65\xA5\x12\x1A\xBB
So what should I do?
My code now looks like:
Solution1:
You don't so much want to remove characters, as convert them to HEX. The binascii library does just that:
Suggested blogs:
>Creating a form in Django to upload a picture from website
>Sending Audio file from Django to Vue
>How to keep all query parameters intact when changing page in Django?
>Solved: TaskList View in Django
>Implement nested serializers in the Django rest framework
>Define blade component property in server - Laravel
>Can not run phpstan under docker with memory lack error