我需要一些帮助来访问元组中的值或条目。你知道吗
考虑以下数据:
('{"email": "test@example.com"}',)
<type 'tuple'>
{"email": "test@example.com"}
<type 'str'>
首先它基本上是一个元组。你知道吗
经过进一步处理,它正在转换为“str:。你知道吗
你可以看看下面的代码。你知道吗
所以这里我需要得到“email”的值。你知道吗
我尝试了以下代码
rows = cur.fetchall()
for row in rows:
print row
print type(row)
for rowitems in row:
print rowitems
print type(rowitems)
有人让我的方式一样。你知道吗
可以使用^{} 将字符串解析为JSON。你知道吗
示例
这将为您提供来自
a_tuple
的emails
列表相关问题 更多 >
编程相关推荐