def write_interactions(G, path, delimiter=' ',  encoding='utf-8'):
    """Write a DyNetx graph in interaction list format.


        Parameters
        ----------

        G : graph
            A DyNetx graph.

        path : basestring
            The desired output filename

        delimiter : character
            Column delimiter
        """
    for line in generate_interactions(G, delimiter):
        line += '\n'
        path.write(line.encode(encoding))