'from ab1 to fasta several times in python3

I have several ab1 files and I want to use a code in python3 to convert them into fasta files.

I have a code that works for one file but I need to make it work for several files (using a loop or re). Could you help me? I am attaching the code that I have to this email.

from Bio import SeqIO
record = SeqIO.parse("EC01_LR.ab1", "abi")
count = SeqIO.write(record, "EC01_LR.fasta", "fasta")
print("Converted %i records" % count)

The names of my ab1 could vary from EC01_LR.ab1 to EC101_LR.ab1 or EC2971_LR.ab1

Thank for the help in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source