- 论坛徽章:
- 0
|
原帖由 blackjimmy 于 2009-2-15 12:54 发表
for line in lists:
temp = line.replace('\n', '').split('\t')
chr = temp[0]
start = temp[1]
end = temp[2]
name = temp[3]
seq = get_oneseq(chr, int(start), int(end))
print >>f2, '>'+name+'\t'+chr+':'+str(start)+'-'+str(end)+'\n'+seq.
chr start end name 这些赋值操作和str(start) str(end)根本没有必要。直接写成get_oneseq(temp[0], int(temp[1]), int(temp[2]))不是一样?如果你想处理一下int操作的异常倒是可以保留start和 end
try:
start = int(temp[1])
end = int(temp[2])
except:
....
另外能不能把测试文本传上来,光看描述不直观。
[ 本帖最后由 luffy.deng 于 2009-2-15 15:47 编辑 ] |
|