python如何實現電影的模糊搜索?
import re f=open('user.txt','r'
) text=f.read() f.close() tofind=raw_input("please input yo want to find:") tofind=re.escape(tofind) result=re.findall(".*"+tofind+".*",text) for line in result: print line
python如何實現電影的模糊搜索?
import re f=open('user.txt','r'
) text=f.read() f.close() tofind=raw_input("please input yo want to find:") tofind=re.escape(tofind) result=re.findall(".*"+tofind+".*",text) for line in result: print line