Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a simple yaml file

Tags:

yaml

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

like image 730
Mike Avatar asked Oct 12 '12 22:10

Mike


People also ask

How do I create a YAML file in Python?

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.

What is YAML for dummies?

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.

Is YAML easy?

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.


1 Answers

It could be that you're using a tab to indent the next line, when you should be using spaces.

like image 96
tanline Avatar answered Oct 31 '22 19:10

tanline