정규식 re.search 관련 (파이썬 시작한지 일주일째)

50 views
Skip to first unread message

파이썬초보

unread,
Feb 20, 2014, 11:21:40 PM2/20/14
to pyt...@googlegroups.com
정규식 seach결과 자꾸 'nonType'이 나옵니다.

if __name__ == "__main__":
   
    mapping=[]
    unmapping=[]
    mapping_Tag=[]
    mapping_Seq=[]
    dict()
    import re

    samFile = "part1 of mapping DB.txt"
    f=open(samFile)
    pool=f.readlines()
      
    for i in pool:
        t=tap_separate=i.split('\t')
       
        if str(t[2]) == '*' :
            unmapping.append(t[0])
            d=dict(unmaapping_seq=t[9]) 
            
        else:
            mapping.append(t[0])
            mapping_Seq.append(t[9])
            mapping_Tag.append(t[10:])
            for line in t:
                search = re.search('NM:i:', line)
                print(line)

print line 하면 string으로 출력되는 문자값이 나오는데,
re.seach에서 line으로 입력시에 왜 검색을 못하는지 모르겠습니다.

samfile 첨부합니다.



part1 of mapping DB.txt
Reply all
Reply to author
Forward
0 new messages