擅长:python、mysql、java
<p>您正在使用write(<code>w</code>)模式,该模式将删除现有文件(<a href="https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files" rel="nofollow">https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files</a>)。改用append(<code>a</code>)模式:</p>
<pre><code>table_file = open('abhi.html', 'a')
</code></pre>