title: Use python to grep lines from one file out of another file
body: <p>Similar question to alternative of "grep" in python; but the complexity here is what is grepped is variable (lines) from another file. I cannot figure out how to do this using functions like re.findall()</p>
  
  <p>file1:</p>
  
  <pre><code>1  20  200
  1  30  300
  </code></pre>
  
  <p>file2:</p>
  
  <pre><code>1  20  200  0.1  0.5
  1  20  200  0.3  0.1
  1  30  300  0.2  0.6
  1  40  400  0.9  0.6
  2  50  300  0.5  0.7
  </code></pre>
  
  <p>Each line from file1 is my pattern; and I need to search such pattern from file2.
  Then result should be:</p>
  
  <pre><code>    1  20  200  0.1  0.5
      1  20  200  0.3  0.1
      1  30  300  0.2  0.6
  </code></pre>
  
  <p>I've been trying to solve the problem using either bash or python,but cannot figure out.
  thx</p>