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
下一篇java工作一年了
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