擅长:python、mysql、java
<p>使用<a href="http://docs.python.org/2/library/stdtypes#str.format">^{<cd1>}</a>。您应该使用write模式(<code>w</code>)打开文件,以便向文件中写入内容。你知道吗</p>
<pre><code>for id, pos in PNposD.iteritems():
print id, 'id'
print pos, 'pos'
with open("/home/{}_candMuts.txt".format(id), 'w') as ofh:
ofh.write("%d\n" % (pos))
</code></pre>