How to save output from python like tsv
问题 I am using biopython package and I would like to save result like tsv file. This output from print to tsv. for record in SeqIO.parse("/home/fil/Desktop/420_2_03_074.fastq", "fastq"): print ("%s %s %s" % (record.id,record.seq, record.format("qual"))) Thank you. 回答1: That is fairly simple , instead of printing it you need to write that to a file. with open("records.tsv", "w") as record_file: for record in SeqIO.parse("/home/fil/Desktop/420_2_03_074.fastq", "fastq"): record_file.write("%s %s %s