擅长:python、mysql、java
<p>我不认为创建表格有用。<br/>
只需将数据放入一个经过调整的结构中,并使用一个函数来显示您在需要时所需的内容:</p>
<pre><code>with open('bio.txt') as f:
data = [line.rstrip().split(None,2) for line in f if line.strip()]
def display(data,nth,pat='%-6s %-15s %s',uz=('th','st','nd','rd')):
print pat % ('no.','score',
'amino acid(%d%s column)' %(nth,uz[0 if nth//4 else nth]))
print '\n'.join(pat % (a,b,c[nth-1]) for a,b,c in data)
display(data,1)
print
display(data,3)
print
display(data,7)
</code></pre>
<p>结果</p>
^{pr2}$