# Saving CanTherm output¶

rmgpy.cantherm.output.prettify(string, indent=4)

Return a “pretty” version of the given string, representing a snippet of Python code such as a representation of an object or function. This involves splitting of tuples, lists, and dicts (including parameter lists) onto multiple lines, indenting as appropriate for readability.

class rmgpy.cantherm.output.PrettifyVisitor(level=0, indent=4)

A class for traversing an abstract syntax tree to assemble a prettier version of the code used to create the tree. Used by the prettify() function.

generic_visit(node)

Called if no explicit visitor function exists for a node.

visit(node)

Visit a node.

visit_Call(node)

Return a pretty representation of the class or function call represented by node.

visit_Dict(node)

Return a pretty representation of the dict represented by node.

visit_List(node)

Return a pretty representation of the list represented by node.

visit_Num(node)

Return a pretty representation of the number represented by node.

visit_Str(node)

Return a pretty representation of the string represented by node.

visit_Tuple(node)

Return a pretty representation of the tuple represented by node.