I am printing a string from a json url. It prints it in different lines. I want to print the string as is (with the '\n' intact).
My code:-
TestDocs= urllib.request.urlopen("solr url").read()
TestDocs_obj = json.loads(TestDocs.decode())
Docs = []
for i in TestDocs_obj['response']['docs']:
matchObj = re.findall(r'open(s)?|education|(?i)sue', i['sentence'])
if not matchObj:
Doc = i["sentence"]
print(Doc)
Docs.append(Doc)
it is printing:-
Microsoft buys a company.
It is located in Spain.
I want:-
Microsoft buys a company.\nIt is located in Spain