Skip to content
Advertisement

Converting a YAML file to JSON object in Python

How can I load a YAML file and convert it to a Python JSON object?

My YAML file looks like this:

JavaScript

Advertisement

Answer

you can use PyYAML

JavaScript

And in the ipython console:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement