I really hate asking this because it should be obvious but I can't get it to work. SO I'm trying to create this simple yaml file:
Day:
MOND:'1s'
TUD:'2s'
WED:'3s'
THD:'4s'
FRD:'5s'
But I'm getting this error:
yaml.scanner.ScannerError: while scanning for the next token found character '\t' that cannot start any token
Write YAML File In PythonOpen config.py and add the following lines of code just below the read_yaml method and above the main block of the file. In the write_yaml method, we open a file called toyaml. yml in write mode and use the YAML packages' dump method to write the YAML document to the file.
YAML is a digestible data serialization language often used to create configuration files with any programming language. Designed for human interaction, YAML is a strict superset of JSON, another data serialization language. But because it's a strict superset, it can do everything that JSON can and more.
YAML is an easy, expressive, data-oriented language that distinguishes itself from document markup languages. YAML Ain't a Markup Language (YAML), and as configuration formats go, it's easy on the eyes.
It could be that you're using a tab to indent the next line, when you should be using spaces.
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