我有一个缩写列表
字母 = ['Ala', 'Asx', 'Cys', ... 'Glx']
我想将它输出到一个看起来像这样的文本文件:
#Letters
Ala, 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()