Pickle
模块和功能有什么区别+str()
?我刚刚写完下面这段代码
def orf(codons):
seqlist = []
flag = False
start = ['ATG']
stop= ['TAA','TGA','TAG']
for i in codons:
if i in start:
flag = True
if flag == True:
seqlist.append(i)
if i in stop:
flag = False
return seqlist
frame1 = string
codons = [frame1[i:i+3] for i in range (0, len(frame1),3)]
one = orf(codons)
seq1 =''.join(one)
output1 = 'Length of 1st open reading frame is:'+str(seq1)
#seq1 =''.join(one)
seq_list.append(seq1)
length1 = len(seq1)
output_1 = '\nSize of 1st open reading frame is:'+str(len(seq1))
length_list.append(length1)
out.write(output1)
out.write(output_1)
我使用+str()
函数来获取(orf (codons))
字符串形式的函数。这可能使用Pickle
. 我确实阅读了 python 教程,但无法理解它的含义。如果你能解决我的代码,我会很棒。