Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
PyYAML package in Pythonista
-
I'm trying to write a basic script that converts YAML to JSON.
By searching this forum, it seems like Editorial has the YAML package built-in, but NOT in Pythonista. Is that correct?'
I've tried importing YAML and also trying a my_dict = yaml.load() command in Pythonista, but they are not recognized.
Finally, is it possible to concert YAML to JSON if I were to buy Editorial?
Warm regards.
-
@atonaltensor try in lowercase
import yaml
and an example here
or
import yaml document = """ a: 1 b: c: 3 d: 4 """ print(yaml.dump(yaml.load(document)))
-
Thank you.
I can't actually be sure why it wasn't working on my first try, but it is now. Thanks.
-
>>> import yaml >>> yaml.__version__ '3.11'