擅长:python、mysql、java
<p>如果您还没有嫁给python,那么使用<code>comm</code>Unix可执行文件(如果您使用的是基于Unix的系统)就可以很容易地做到这一点:</p>
<pre><code>$ comm -13 file1.txt file2.txt
4
5
6
7
8
9
10
</code></pre>
<p>这假设文件是预先排序的。你知道吗</p>
<p>你可以很容易地<a href="https://stackoverflow.com/questions/4256107/running-bash-commands-in-python">call this from Python</a>。你知道吗</p>
<p><a href="https://stackoverflow.com/questions/8598250/using-comm-to-diff-two-files">More info on how to use ^{<cd1>}</a></p>