Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to extract dictionary value from string in python

import ast
temp = "'mycode':['1','2','firstname','Lastname']"
key,value = map(ast.literal_eval, temp.split(':'))
status = {key: value}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #extract #dictionary #string #python
ADD COMMENT
Topic
Name
3+3 =