python dict into json string
import json
# Data to be written
dictionary ={
"A": 5,
"B": "guys",
}
# Serializing json
json_object = json.dumps(dictionary, indent = 4)
print(json_object)
# Output
{
"A": 5,
"B": "guys",
}# app.py
import json
appDict = {
'name': 'messenger',
'playstore': True,
'company': 'Facebook',
'price': 100
}
app_json = json.dumps(appDict)
print(app_json)import json
with open('result.json', 'w') as fp:
json.dump(sample, fp)
Also in JavaScript:
- making promises in js
- javascript find item in array of objects
- mysql JSON_SEARCH LIKE
- javascript current date add 30 days
- resellerclub api with react js
- javascript set and get cookie
- type of javascript
- emmet react self closing tags
- javascript upload file button
- hi;ight word in textarea javascript
- es6 array sum javascript
- javascript how to do else if
- react map
- check data type in javascript
- javascript remove function from object
- add id in jquery
- javascript transfer to another page
- how to remove name in react navigation header
- javascript detect square number
- 0.1 + 0.2 javascript
- twig for
- create csv file javascript
- javascript syntax for check null or undefined or empty
- jquery watch checkbox change