Python Forum
converting mysqli to json
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting mysqli to json
#2
you've got a list with one item that is a dictionary
you didn't supply much information about your code, nor a code example, so
lets assume the name of your converted JSON list is mylist, then
if you try:
>>> type(mylist)
<class 'list'>
>>> type(mylist[0])
<class 'dict'>
>>> mydict = mylist[0]
>>> type(mydict)
<class 'dict'>
>>> print(mydict)
{'rowId': 21, 'nature': 'O', 'symbol': 'TAL', 'qty': 10, 'daysHeld': 0, 'source': 'Momentum', 'dayEntered': '2018-01-16', 'pl': -40} >>>
Reply


Messages In This Thread
converting mysqli to json - by ameliabob - Jul-03-2018, 03:01 PM
RE: converting mysqli to json - by Larz60+ - Jul-03-2018, 03:25 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020