Converting automata to strings

Use to_str() to output a string representing the automaton in different formats.

Saving automata to files

Use save() to save the automaton into a file.

Reading automata from files

Use spot.automata() to read multiple automata from a file, and spot.automaton() to read only one.

The --ABORT-- feature of the HOA format allows discarding the automaton being read and starting over.

Reading automata from strings

Instead of passing a filename, you can also pass the contents of a file. spot.automata() and spot.automaton() look for the absence of newline to decide if this is a filename or a string containing some actual automaton text.

Reading automata output from processes

If an argument of spot.automata ends with |, then it is interpreted as a shell command that outputs one automaton or more.

A single automaton can be read using spot.automaton(), with the same convention.