Search code examples
pythonstringyamlpyyaml

How to write to a string instead of a file wth PyYaml


I can write to a file using yaml.dump but how do I write to a string?


Solution

  • I have found the solution. Its an overloaded function. If you don't pass the file parameter, it will output to a string.