标签:功能 匹配 代码 查看 amount code ict gre log
现需要对这个员工信息文件,实现增删改查操作
UPDATE staff_table SET dept="Market" WHERE where dept = "IT"
1 def computing_dictionary(args): 2 computing = { 3 ‘<‘: greater, 4 ‘>‘: less, 5 ‘=‘: amount, 6 ‘like‘: like, 7 } 8 def greater(args,args_1): 9 date = open_file() 10 key = db[args] 11 number = 0 12 for item in date: 13 select_date = re.split(",", item) 14 if select_date[key] < args_1 : 15 print(item) 16 number += 1 17 print("共查询到%s条" %(number)) 18 19 def less(args,args_1): 20 date = open_file() 21 key = db[args] 22 print(key) 23 number = 0 24 for item in date: 25 select_date = re.split(",", item) 26 print(select_date) 27 if select_date[key] > args_1 : 28 print(item) 29 number += 1 30 print("共查询到%s条" %(number)) 31 def amount(args,args_1): 32 date = open_file() 33 key = db[args] 34 number = 0 35 print(args_1) 36 for item in date: 37 # if len(item)< 2 : 38 # continue 39 select_date = re.split(",", item) 40 print(select(key)) 41 if select_date[key] == args_1 : 42 print(item) 43 number += 1 44 print("共查询到%s条" % (number)) 45 def like(args,args_1): 46 date = open_file() 47 key = db[args] 48 number = 0 49 for item in date: 50 select_date = re.split(",", item) 51 if select_date[key].find(args_1) >= 0: 52 print(item) 53 number += 1 54 print("共查询到%s条" %number)
标签:功能 匹配 代码 查看 amount code ict gre log
原文地址:http://www.cnblogs.com/diyusishen/p/6291226.html