code: def to_dotfile(self, filename):
          
          with codecs.open(filename, "w", "utf-8") as file:
              for line in self:
                  file.write("%s\n" % line)
docs: Write graph to `filename`.
  
          >>> from anytree import Node
          >>> root = Node("root")
          >>> s0 = Node("sub0", parent=root)
          >>> s0b = Node("sub0B", parent=s0)
          >>> s0a = Node("sub0A", parent=s0)
          >>> s1 = Node("sub1", parent=root)
          >>> s1a = Node("sub1A", parent=s1)
          >>> s1b = Node("sub1B", parent=s1)
          >>> s1c = Node("sub1C", parent=s1)
          >>> s1ca = Node("sub1Ca", parent=s1c)
  
          >>> from anytree.exporter import DotExporter
          >>> DotExporter(root).to_dotfile("tree.dot")
  
          The generated file should be handed over to the `dot` tool from the
          http://www.graphviz.org/ package::
  
              $ dot tree.dot -T png -o tree.png