Create the ePCR-compatible primer file from the dictionaries of primer combinations

def epcr_primer_file(self, formattedprimers):
        """
        Create the ePCR-compatible primer file from the dictionaries of primer combinations
        """
        logging.info('Creating re-PCR-compatible primer file')
        with open(formattedprimers, 'w') as formatted:
            # Iterate through all the targets
            for basename in sorted(self.forward_dict):
                # Use enumerate to number the iterations for each forward and reverse primer in the lists
                for forward_index, forward_primer in enumerate(self.forward_dict[basename]):
                    for reverse_index, reverse_primer in enumerate(self.reverse_dict[basename]):
                        # Set the name of the primer using the target name, and the indices of the primers
                        # e.g. vtx1a_0_0
                        primer_name = '{bn}_{fi}_{ri}'.format(bn=basename,
                                                              fi=forward_index,
                                                              ri=reverse_index)
                        # Create the string to write to the ePCR-compatible primer file
                        # e.g. vtx1a_0_0	CCTTTCCAGGTACAACAGCGGTT	GGAAACTCATCAGATGCCATTCTGG
                        output_string = '{pn}\t{fp}\t{rp}\n'.format(pn=primer_name,
                                                                    fp=forward_primer,
                                                                    rp=reverse_primer)
                        # Write the string to file
                        formatted.write(output_string)