I have a simpl example:
test = """test
dsdssd
dsdssd
"""
def html_doc(args):
return Environment().from_string(test).render(args)
print html_doc({ })
How to add "carriage return" (\r) in the end of each string ?
test = str.replace(test, '\n', '\r\n')
EDIT: Python automatically tries to take care of newlines for reading and writing files, but I assume because the question is tagged as jinja2 that this string isn't being written to a file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With