#!/usr/bin/python

fname = "a.txt”
nfname = "b.txt"

f = open(fname)  
for line1 in f:     
    print 'line : %s ' %line1
    nnif = open(nfname)
    for line2 in nnif:
        if line1 in line2 : 
            print 'found string in file %s' %line2
            break

Posted by 김용환 '김용환'