I’ve tried str.replace(“\”, “”) (reddit seems to reed 4 slashes as 2… Assume it’s double the amount here) and str.replace(r””, r””), it doesn’t work.
Please help I’m desperate.
json_output = json.load(open(filepath))[“subsection”][3][“intro”]
latex_output = “”
for paragraph in json_output:
latex_output += f”{paragraph}”
latex_output = ( latex_output.replace(r”href”, r”href”) .replace(r”begin”, r”begin”) .replace(r”end”, r”end”) .replace(r”item”, r”item”) )
print(latex_output)
submitted by /u/Minisabel
[link] [comments]
r/learnpython I’ve tried str.replace(“\”, “”) (reddit seems to reed 4 slashes as 2… Assume it’s double the amount here) and str.replace(r””, r””), it doesn’t work. Please help I’m desperate. json_output = json.load(open(filepath))[“subsection”][3][“intro”] latex_output = “” for paragraph in json_output: latex_output += f”{paragraph}” latex_output = ( latex_output.replace(r”href”, r”href”) .replace(r”begin”, r”begin”) .replace(r”end”, r”end”) .replace(r”item”, r”item”) ) print(latex_output) submitted by /u/Minisabel [link] [comments]
I’ve tried str.replace(“\”, “”) (reddit seems to reed 4 slashes as 2… Assume it’s double the amount here) and str.replace(r””, r””), it doesn’t work.
Please help I’m desperate.
json_output = json.load(open(filepath))[“subsection”][3][“intro”]
latex_output = “”
for paragraph in json_output:
latex_output += f”{paragraph}”
latex_output = ( latex_output.replace(r”href”, r”href”) .replace(r”begin”, r”begin”) .replace(r”end”, r”end”) .replace(r”item”, r”item”) )
print(latex_output)
submitted by /u/Minisabel
[link] [comments]