Answer the question
In order to leave comments, you need to log in
How to make friends PostgreSQL and MS SQL on the same server?
Good time of the day. It is installed on the MS SQL 2008 + 2012 server. There was a task to install software with PostgreSQL embedded on the server. I wondered about their friendship and possible troubles. Can anyone advise?
Answer the question
In order to leave comments, you need to log in
In your specific case, then:
>>> test = "[{'tzid': '000000000', 'phone': '000000', 'service': 'test', 'status': 'TZ_NUM_PREPARE'}]"
>>> import json
>>> print(json.loads(test.replace("'", '"')))
[{'tzid': '000000000', 'phone': '000000', 'service': 'test', 'status': 'TZ_NUM_PREPARE'}]
>>> print(json.loads(test.replace("'", '"'))[0]['tzid'])
000000000
It's not JSON. Double quotes in JSON
In [6]: x = '[{"tzid": "000000000", "phone": "000000", "service": "test", "statu
...: s": "TZ_NUM_PREPARE"}]'
In [7]: x
Out[7]: '[{"tzid": "000000000", "phone": "000000", "service": "test", "status": "TZ_NUM_PREPARE"}]'
In [8]: json.loads(x)
Out[8]:
[{'tzid': '000000000',
'phone': '000000',
'service': 'test',
'status': 'TZ_NUM_PREPARE'}]
what exactly is the problem?
they do not interact with each other and do not interfere with each other (except for the consumption of resources).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question