I have a list which is in single quotes.
'[{"Name":"name1","value":"value1"},{"name":"name2","value":"value2"}]'
I receive this as an input parameter and I would like to assign this to a variable without the enclosing single quotes in python.
Could you please help?
The sample data received is close to something below..
'[{"name":"emp_id","value":3232323},{"name":"dd_approval","value":"-paid -fulltime \"05/03/21 19:46\" \"05/04/21 19:46\" xyz@dmuil.com 3232323"}]'
json.loads(this string)
Gives an error as given below
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded