Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dict to bytes python

# You can use indent option in json.dumps() to obtain 
 symbols:

	import json

	user_dict = {'name': 'dinesh', 'code': 'dr-01'}
	user_encode_data = json.dumps(user_dict, indent=2).encode('utf-8')
	print(user_encode_data)

# Output:
	b'{
  "name": "dinesh",
  "code": "dr-01"
}'
Source by www.google.com #
 
PREVIOUS NEXT
Tagged: #dict #bytes #python
ADD COMMENT
Topic
Name
1+3 =