python dict to json
import json
appDict = {
'name': 'messenger',
'playstore': True,
'company': 'Facebook',
'price': 100
}
app_json = json.dumps(appDict)
print(app_json)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:
- react route multiple components
- how to change string to array in javascript
- json_decode jquery
- js tab in textarea
- js array includes
- prevent double tap in react native
- jquery remove array element by key
- jquery select input value empty and hasclass
- hoisting in javascript
- get image center pixels nodejs
- how to remove warnings in react js console
- how to make a array in javascript
- add st nd rd th javascript
- javascript ...
- how to assign onEdit to specigfic tab
- first element of array js
- linear search js
- express signed cookies
- typeof javascript
- js create tag
- different ways to write react file paths
- Arranging Coins
- $ is not defined
- match 10-12 digit javascript safaricom