code: def linexand (listoflists,columnlist,valuelist):
      
      if type(columnlist) not in [ListType,TupleType]:
          columnlist = [columnlist]
      if type(valuelist) not in [ListType,TupleType]:
          valuelist = [valuelist]
      criterion = ''
      for i in range(len(columnlist)):
          if type(valuelist[i])==StringType:
              critval = '\'' + valuelist[i] + '\''
          else:
              critval = str(valuelist[i])
          criterion = criterion + ' x['+str(columnlist[i])+']=='+critval+' and'
      criterion = criterion[0:-3]         # remove the "and" after the last crit
      function = 'filter(lambda x: '+criterion+',listoflists)'
      lines = eval(function)
      return lines
docs: Returns the rows of a list of lists where col (from columnlist) = val
  (from valuelist) for EVERY pair of values (columnlist[i],valuelists[i]).
  len(columnlist) must equal len(valuelist).
  
  Usage:   linexand (listoflists,columnlist,valuelist)
  Returns: the rows of listoflists where columnlist[i]=valuelist[i] for ALL i