1

{"1":null, "2":false, "3":true}

I don't need them to be converted to None False True.

3
  • 1
    Have you tried json.dump/json.dumps Commented Dec 29, 2020 at 5:56
  • there is no clarity in the question neither it shows what you have tried Commented Dec 29, 2020 at 5:57
  • null is not defined in python, you have to convert it to "None" Commented Dec 29, 2020 at 5:59

2 Answers 2

6

According to this page https://www.w3schools.com/python/python_json.asp

The python None Type is converted to null that you're looking for

Python JSON
dict Object
list Array
tuple Array
str String
int Number
float Number
True true
False false
None null
Sign up to request clarification or add additional context in comments.

Comments

-1
with open(r"D:\microsoft presentation\json.json", 'w+') as outfile:
     json.dump(output, outfile, sort_keys = False, indent = 4, ensure_ascii = False)

https://stackoverflow.com/a/20776329/13226851

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.