title: concatenate 2 readed files python
body: <p>I was trying to generate all the hex numbers from <code>0000000000</code> to <code>FFFFFFFFFF</code> with all combinations on 10 length string but the file size it was very large, so i think to divide in two lists from <code>00000</code> to <code>fffff</code> and then join that lists through <code>stdout</code> and pipe it to aircrack</p>
  
  <p>The code:</p>
  
  <pre class="lang-python prettyprint-override"><code>#!/usr/bin/python
  # -*- encode: utf-8
  import sys
  
  def main():
  
      fd = open("hexdic.txt", "r")
      ffdd = open("dichex.txt","r")
      for line in fd.readlines():
  
              for otra in ffdd.readlines():
                      print line.replace("\n","") + otra.replace("\n","")
  
      fd.close()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>the issue is when the file take the first line on the first file "00000" and run all the other lines on the second file from "00000" to "FFFFF" the program finish instead to continue with "00001" from the first list and run all the second list.</p>
  
  <p>why? </p>
  
  <p>well i think to use regex to generate random combinations.</p>
  
  <p>Can you help me with my code showing me what am i doing wrong?</p>