簡體   English   中英

MySQL python DBAPI。 如何獲得字典而不是元組?

[英]MySQL python DBAPI. How to get a dictionary instead of a tuple?

在執行的游標上調用fetchall時,Python DB API返回元組列表。 如果使用_mysql模塊,fetch_row有一個how參數,允許獲取字典而不是元組。 如何用光標實現同樣的效果?

引用文檔

DictCursor
    Like Cursor except it returns rows as dictionaries.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM