向fi写出字符串列表

2024-10-03 23:27:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一份缩写表

字母=['Ala'、'Asx'、'Cys'、…'Glx']

我想将其输出到一个文本文件,该文件如下所示:

字母
阿拉巴马州,Asx,Cys。。。。。Glx公司

这里没有程序员!我总是忘记最简单的事情!啊

请帮忙,谢谢!在

import Bio
from Bio import Seq
from Bio.Seq import Alphabet

output = 'alphabetSoupOutput.txt'
fh = open(output, 'w')
ThreeLetterProtein = '#Three Letter Protein'
Letters = Bio.Alphabet.ThreeLetterProtein.letters
fh.write(ThreeLetterProtein + '\n')

  #Don't know what goes here

fh.close()

Tags: 文件fromimportoutput字母seqbio文本文件