[英]convert a tuple into a string in python
我有一个元组
tup = ('\x00\x05(^\x9a\xdd\x1c\xb3\xe0T\x00!(\xa8z\xd8', 0, 'ABC', 0, None, None, None, None, None, None, None)
我想将其转换为管道分隔的字符串
\x00\x05(^\x9a\xdd\x1c\xb3\xe0T\x00!(\xa8z\xd8|0|ABC|0|None|None|None|None|None|None
我正在做这样的事情并出现以下错误
''.join(tup)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: sequence item 1: expected string, int found
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.