looking for thunder link

#! encoding=gbk

import re

file_object = open('1.txt')
f = open("2.txt","w")
for line in file_object:
    m = re.findall('(thunder(.+)pa)',line)
    if m:
        print >> f,m[0][0];

f.close()
file_object.close()	

version 2

#! encoding=gbk

import re

file_object = open('1.txt')
f = open("2.txt","w")
for line in file_object:
    m = re.findall('thunder.+pa',line)
    if m:
        print >> f,m[0];

f.close()
file_object.close()	


猜你喜欢

转载自blog.csdn.net/llrraa2010/article/details/50988979
今日推荐