'Iterate through the data and create the needed output.txt file, appending to file as necessary.'

def create_file(self):

    with open(self.output, 'a') as output_file:
        for data_element in self.data:
            if (data_element.get('module') or data_element.get('function')):
                method_signature = data_element.get('method_signature')
                first_paragraph = (('<p>' + data_element.get('first_paragraph')) + '</p>')
                (name, redirect) = self.create_names_from_data(data_element)
                if first_paragraph.startswith('Source    code:'):
                    temp = first_paragraph.split('.py', 1)
                    if (len(temp) > 1):
                        first_paragraph = ((temp[0] + '.py<br>') + temp[1])
                abstract = (('<section    class="prog__container">' + '{}{}{}'.format(first_paragraph, '', method_signature)) + '</section>')
                url = data_element.get('url')
                list_of_data = [name, 'A', '', '', '', '', '', '', 'https://docs.python.org', '', '', abstract, url]
                output_file.write('{}\n'.format(' DCTB '.join(list_of_data)))
                if (redirect != name):
                    list_of_data = [redirect, 'R', name, '', '', '', '', '', '', '', '', '', '']
                    output_file.write('{}\n'.format(' DCTB '.join(list_of_data)))
