1

I have a bunch of numbers in a string array and I feel like they are bunch of bytes.

I wonder how I can convert those numbers into an actual string representation. I guess I need to convert this string array to a byte array and later I can decode this byte array to string.

Any help?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Tarik
  • 79,711
  • 83
  • 236
  • 349

1 Answers1

4

Something like this?

>>> s = "104,101,108,108,111"
>>> "".join(chr(int(number)) for number in s.split(","))
'hello'
Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561