And what about list comprehensions? If result is ((123,), (234,), (345,))
:
>>> row = [item[0] for item in cursor.fetchall()]
>>> row
[123, 234, 345]
If result is ({'id': 123}, {'id': 234}, {'id': 345})
:
>>> row = [item['id'] for item in cursor.fetchall()]
>>> row
[123, 234, 345]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…