How do I convert a list of ascii values to a string in python?

Electrons_Ahoy :

I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values. How do I convert this into a "regular" string that I can echo to the screen?

Thomas Wouters :

You are probably looking for 'chr()':

>>> L = [104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100]
>>> ''.join(chr(i) for i in L)
'hello, world'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I convert a list of ASCII "Bytes" in Python into Hex Bytes

How do i convert a ascii python string to its trinary representation

How do I convert from ASCII to String

Python: How to convert all values in a list to their ascii values?

How do I convert a hex string to an Ascii string in Kusto

How do I convert a list into a string with spaces in Python?

How do I convert a list of integers to a string - Python

How do I remove string '' from python dictionary list values?

How do I convert Encoding.ASCII.GetBytes to string

How do i convert string.byte to their ascii hex value

How to convert String values in a dictionary to a list in python?

How do I interpret ASCII values of characters of a string as chars in C?

How do I convert List<String[]> values from UTF-8 to String?

How can I convert string to get ASCII numbers in python?

How do I convert a string to a list of chars?

How do I convert unicode characters (ASCII 10) to text in Python

How do I convert a TreeMap that is a <String, <List<String>> to String[][]?

How do i convert a String to a List<Map<String,String>>

How do I convert list into dictionary in Python?

How do I convert a string into bytes in python?

How do I convert this string into a dict in python?

How do I convert a string into code in Python?

How do I convert a string to math in python?

in C# how do I convert what I think is a string of hex ascii to something i can read?

How do i convert from ASCII to Decimal

how do I convert a list of custom type to a list of String

How do I convert a list represented as a string to a list?

How do I concisely convert a python dictionary to a list of tuples, given a dictionary in which the values may be different types?

How to convert a full ascii string to hex in python?