title: create python list on the fly
body: <p>I am trying to create python list on the fly. I have two files, one has keys an other file have keys and values.</p>
  
  <p>key file: File1:</p>
  
  <pre><code>abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        30319
  abc_506        105152
  abc_506        105152
  abc_506        105152
  abc_506        105152
  abc_506        105152 
  abc_506        56789
  abc_506        56789
  </code></pre>
  
  <p>File2:</p>
  
  <pre><code>abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        30319    SomeInfo
  abc_506        105152   otherInfo
  abc_506        105152   otherInfo
  abc_506        105152   otherInfo
  abc_506        105152   otherInfo
  abc_506        105152   otherInfo
  </code></pre>
  
  <p>I am trying to match the data from file1 to file2 to create a list like below.  If there are extra keys in file1..the list should contain "NNNNNNNNN" for that key.</p>
  
  <pre><code>list1=[['someInfo','someInfo','someInfo','someInfo','someInfo','someInfo','someInfo','someInfo','someInfo'],['OtherInfo','OtherInfo','OtherInfo','OtherInfo','OtherInfo'],["NNNNNNNNNNNNNNNNNNNN"]]
  </code></pre>
  
  <p>What I am trying is:</p>
  
  <p>import motility</p>
  
  <pre><code>File1=open("File1",'r')
  File2=open("File2",'r')
  
  File1_dict = {}
  
  list2=[]
  
  for line in File1:
          line=line.strip()
          File1_dict[line]=1
  
  
  for keys in File1_dict.keys():
          list1=[]
          for line in File2:
                  fields=line.split("\t")
                  key=fields[0]+"\t"+fields[1]
                  if key==keys:
                      list1.append(fields[2])
                  else:
                      list1.append("NNNNNNNNNNNNNNNNNNNN")
          list2.append(list1)
  
  print list2
  </code></pre>
  
  <p>But its not working I am expecting list2 contains list of list</p>