整数数组到 Python 中的字符串

pro*_*eek 2 python converter

我有一个整数数组,我需要将它转换为字符串。

[1,2,3,4] => '\x01\x02\x03\x04'
Run Code Online (Sandbox Code Playgroud)

我可以使用什么功能?我尝试使用 str(),但它返回“1234”。

string = ""
for val in [1,2,3,4]:
    string += str(val) # '1234'
Run Code Online (Sandbox Code Playgroud)

cal*_*pto 6

''.join([chr(x) for x in [1, 2, 3, 4]])