The output can also be written to a file.
>>>from Bio import Entrez
>>>Entrez.email = "[email protected]" >>>record_ids = ["NM_000546.6", "NM_001354689.3"]
>>>for record_id in record_ids: ... with Entrez.efetch(db="nucleotide", id=record_id, rettype="gb", retmode="text") as handle: ... line_count = 0 ... for line in handle: ... print(line.rstrip()) ... line_count += 1 ... if line_count == 2: # Print only first 2 lines of the record ... break
LOCUS NM_000546 2512 bp mRNA linear PRI 12-JUN-2025 DEFINITION Homo sapiens tumor protein p53 (TP53), transcript variant 1, mRNA. LOCUS NM_001354689 3251 bp mRNA linear PRI 12-JUN-2025 DEFINITION Homo sapiens Raf-1 proto-oncogene, serine/threonine kinase (RAF1)
Filogeneza thumb|300px|Rysunek 1: Drzewo filogenetyczne stworzone przez Bio.Phylo, przedstawiające powiązania między homologami różnych organizmów
thumb|Rysunek 2: To samo drzewo, co powyżej, narysowane za pomocą Graphviz za pośrednictwem Bio.Phylo