def METHOD_NAME(self,filename):
    f = ptStream()
    f.open(filename,"w")
    lines = []
    for entry in self.entries:
        if entry.type == kBlankLine:
            lines.append(os.linesep)
        elif entry.type == kComment:
            lines.append(entry.comment+os.linesep)
        elif entry.type == kCommandValue:
            l = entry.command
            for v in entry.values:
                l += " " + v
            lines.append(l+os.linesep)
    f.writelines(lines)
    f.close()