Python

Converting character to ascii back and forth

wowbelly 2019. 2. 9. 17:13

ASCII to int:

ord('a')

gives 97

And back to a string:

  • in Python2: str(unichr(97))
  • in Python3: str(chr(97))

gives 'a'



https://stackoverflow.com/questions/3673428/convert-int-to-ascii-and-back-in-python/3673447

저작자표시 비영리 변경금지 (새창열림)