문제

Python DB API returns a list of tuples when fetchall is invoked on an executed cursor. If you work with the _mysql module, fetch_row has a how parameter that allows to get a dictionary instead of a tuple. How can I achieve the same with the cursor ?

도움이 되었습니까?

해결책

Quoting from the documentation

DictCursor
    Like Cursor except it returns rows as dictionaries.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top