#!/usr/bin/env python3 def FetchSeq(mydb, myrettype, myretmode, myid): from Bio import Entrez from Bio import SeqIO Entrez.email = "lb@laurentbloch.org" with Entrez.efetch(db=mydb, rettype=myrettype,\ retmode=myretmode, id=myid) as handle: seq_record = SeqIO.read(handle, "fasta") print("%s with %i features"\ % (seq_record.id, len(seq_record.features))) FetchSeq("nucleotide", "fasta", "text", "6273291") # -> AF191665.1 with 0 features