| #!/usr/bin/python fname = "a.txt” f = open(fname) |
'python' 카테고리의 다른 글
| [ipython] Pandas 라이브러리 사용시 좋은 레퍼런스 (0) | 2015.07.07 |
|---|---|
| [ipython] numpy.dtype has the wrong size, try recompiling 해결 (0) | 2015.07.07 |
| [ipython] 설치 & 테스트 (0) | 2015.07.03 |
| python- 하나의 파일에서 라인을 읽어서 다른 파일에 똑같은 파일이 있는지 비교하는 코드 (1) | 2012.10.25 |
| [Go Language] 링크 모음 (0) | 2010.06.10 |
| Python development with Eclipse and Ant - pydev (0) | 2006.02.06 |



댓글을 달아 주세요
nnif 가 아래처럼 for 문 밖에 있어야 하지 않을까요 ?
#!/usr/bin/python
fname = "a.txt”
nfname = "b.txt"
f = open(fname)
nnif = open(nfname)
for line1 in f:
print 'line : %s ' %line1
for line2 in nnif:
if line1 in line2 :
print 'found string in file %s' %line2
break