zoukankan      html  css  js  c++  java
  • 作业大礼包_员工信息表

    '''select name, age where age>22
    select * where job=IT
    select * where phone like 133'''
    def age_judge(than):
        l =[]
        f = open('info')
    
        if 'great'==than:
            for i in f:
                age = b[1].split('>')[1]
                age_info=i.split(',')[2]
                l.append(i.strip()) if age < age_info  else l
            f.close()
            return l
        elif 'small'==than:
            for i in f:
                age = b[1].split('<')[1]
                age_info=i.split(',')[2]
                l.append(i.strip()) if age > age_info  else l
            f.close()
            return l
        pass
    def job():
        l = []
        find_job=b[1].split('=')[1]
        f = open('info')
        for i in f:
            real_job=i.split(',')[4]
            l.append(i.strip()) if real_job==find_job else l
        f.close()
        return l
    def phone():
        l = []
        find_phone = b[1].split(' like ')[1]
        f = open('info')
        for i in f:
            real_phone = i.split(',')[3]
            l.append(i.strip()) if find_phone in real_phone else l
        f.close()
        return l
    def input_info_deal():
        if 'age'and'<' in b[1]:
            return age_judge('small')
        elif 'age'and'>' in b[1]:
            return age_judge('great')
        elif 'job' in b[1]:
            return job()
        elif 'phone' in b[1]:
            return phone()
    def end():
        end_deal=input_info_deal();
        if end_deal==[]:
            print('sorry,i can,t find your information')
        else:
            for i in end_deal:
                print(i.split(',')[1],i.split(',')[2])
    a= input('请输入你要查找的信息:')
    b = a.split(' where ')
    end()
  • 相关阅读:
    【sqlite】python备份数据库
    【elasticsearch】python下的使用
    Raft
    SQL注入攻击和防御
    The world beyond batch: Streaming 101
    MillWheel: Fault-Tolerant Stream Processing at Internet Scale
    Flink DataSet API Programming Guide
    The Dataflow Model 论文
    让Storm插上CEP的翅膀
    Siddhi CEP Window机制
  • 原文地址:https://www.cnblogs.com/accolade/p/10495913.html
Copyright © 2011-2022 走看看