2024-09-22 16:37:06 发布
网友
我用phthon写了一个从mysql获取数据的程序
query = ("select distinct packet from http_sum where downloadspot = 'dilian'") cursor.execute(query) for (packet) in cursor: cdndata_name.append(packet)
如你所见,这是如此很简单,但是我得到了这样的数据:(u'panzarcn.rar公司',) 如何转换成字符串,谢谢
这不是一个错误的数据类型,它是unicode,您应该使用它来处理代码中的文本。如果您真的需要将其转换为str,请查看the question linked by @Lafexlos中的答案。你知道吗
unicode
str
这不是一个错误的数据类型,它是
unicode
,您应该使用它来处理代码中的文本。如果您真的需要将其转换为str
,请查看the question linked by @Lafexlos中的答案。你知道吗相关问题 更多 >
编程相关推荐