Dump Multiline string to toml file
reisenmachtfreude opened this issue · comments
John commented
How can I dump an multi-line string to a toml file?
My approach was:
mystr = """Some
content"""
with open('dump.toml', 'w') as f:
toml.dump({'content' : mystr}, f)
Expected output in toml file:
mystr="""Some
content"""
However, the content was automatically converted to a single line string
mystr="Some\\ncontent"
Is there any code which helps to reach my expected result?
Mark Gillard commented
This is the repository for the TOML language, not any particular implementation. You'll need to find the github or package repository for the implementation you're using and ask your question there.
Looks like python, might be one of:
(there are others, too.)
John commented
Great! Thank you very much!