请举个例子,我发现很难使Mysql db结果成为jsonobject。
cur.execute('select title, text from posts order by id desc')
posts = [dict(title=row[0], text=row[1]) for row in cur.fetchall()]
Now you should get python list(dictionary).You can appl this in your database.
Hope this will help for you
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.