Python Forum
json.dumps to keep dictionary keys
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
json.dumps to keep dictionary keys
#2
result = {
        'RAM' : mem._asdict()
         }
 
print(json.dumps(result))
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
json.dumps to keep dictionary keys - by batchenr - May-14-2019, 11:14 AM
RE: json.dumps to keep dictionary keys - by buran - May-14-2019, 11:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question How do I skipkeys on json file read to python dictionary? BrandonKastning 3 1,902 Mar-08-2022, 09:34 PM
Last Post: BrandonKastning
  Adding keys and values to a dictionary giladal 3 2,499 Nov-19-2020, 04:58 PM
Last Post: deanhystad
  saving a dictionary as json file vinay_py 6 3,116 Jun-06-2020, 05:07 PM
Last Post: vinay_py
  access dictionary with keys from another and write values to list redminote4dd 6 3,258 Jun-03-2020, 05:20 PM
Last Post: DeaD_EyE
  Drop Keys From Dictionary donnertrud 8 3,725 May-30-2020, 11:39 AM
Last Post: DeaD_EyE
  json.dumps list output qurr 12 5,253 Apr-08-2020, 10:13 PM
Last Post: micseydel
  Not Getting the Desired value using json.dumps saurabh210 0 1,513 Feb-03-2020, 06:48 PM
Last Post: saurabh210
  json.dumps output error in python3 prayuktibid 2 2,661 Jan-21-2020, 06:41 AM
Last Post: prayuktibid
  Problem adding keys/values to dictionary where keynames = "property" and "value" jasonashaw 1 2,059 Dec-17-2019, 08:00 PM
Last Post: jasonashaw
  accessing Json dictionary lshankar 1 1,853 Dec-16-2019, 06:18 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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