zhishiku_calc.py 263 B

1234567
  1. import re
  2. calc_pattern = re.compile('[\\d\\.\\+\\*\\/-]+')
  3. def find(search_query,step = 0):
  4. try:
  5. return [{'title': "[闻达计算器]()", 'content':calc+"="+str(eval(calc))} for calc in calc_pattern.findall(search_query)]
  6. except:
  7. return[]
粤ICP备19079148号