Python - Convert string of integers to Ascii

Viewed 4168

Currently I work on a project with an NFC tag reader. All data is stored in decimal values and I managed to track the data I need down and cut every special character out of it. I now want to convert it to ascii so it prints out a readable version of the data.

The variable setvar is a string and has the value "84 97 103 32 78 117 109 98 101 114 32 49"

This is the code I try to use:

print "ASCII value: ", ´,´.join(str(chr(c)) for c in setvar)

Sadly this produces an error that this function needs integers. Now my next step would be to convert my string to an array(?) and read each item of that array with a loop. Sadly I have no idea how to do that.

How to do that?

5 Answers
Related