<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      分享一個記錄人員變化的腳本...

      使用前提需要每天復制所有群成員的按鈕,然后每天保存成文件放到腳本同目錄就可以.

        1 #!/usr/bin/env python
        2 # -*- coding:utf-8 -*-
        3 import sys
        4 import os
        5 
        6 PRINTRED = "\033[1;31m"
        7 PRINTGREEN = "\033[0;32;47m"   #green color backgroud is white
        8 PRINTGREEN_SIM = "\033[1;32m"  #no backgroud green color
        9 PRINTBLUE = "\033[1;34m"
       10 PRINTCOLOR_END= "\033[0m"
       11 
       12 def getPersonList(fileName):
       13     try:
       14         fp = open(fileName, 'r')
       15         fLines = fp.readlines()
       16         fp.close()
       17         perList = []
       18         for line  in  fLines:
       19             perSplit = line.split(';')
       20             for item in perSplit:
       21               perList.append(item)
       22 
       23         #print(perList)
       24         return perList
       25     except IOError:
       26         print("error: file not found, please check it !!!")
       27         sys.exit(0)
       28 
       29 def calPersonDiffResult(orgList, compList):
       30     #find delete person
       31     countdel = 0
       32     countadd = 0
       33     for org in orgList:
       34         find = 0
       35         for comp in compList:
       36             if (org == comp):
       37                 find = 1
       38         if (find == 0):
       39             countdel += 1
       40             print(("減少人員姓名:[{cstart}%s{cend}] !").format(cstart=PRINTRED,cend=PRINTCOLOR_END) % org)
       41     print(("總減少人數:[{cstart}%d{cend}] 人!!!").format(cstart=PRINTRED,cend=PRINTCOLOR_END) % countdel)
       42 
       43     #find add person
       44     for comp in compList:
       45         find = 0
       46         for org in orgList:
       47             if (comp == org):
       48                 find = 1
       49         if (find == 0):
       50             countadd += 1
       51             print(("添加人員姓名:[{cstart}%s{cend}] !").format(cstart=PRINTGREEN_SIM,cend=PRINTCOLOR_END) % comp)
       52     print(("總添加人員人數:[{cstart}%d{cend}] 人!!!\n\n").format(cstart=PRINTGREEN_SIM,cend=PRINTCOLOR_END) % countadd)
       53 
       54 
       55 #默認選擇當前路徑人員列表文件
       56 def exploreFiles(curDir = './'):
       57     '''
       58     fList = []
       59     for root,dirs,files in os.walk(curDir):
       60         for file in files:
       61             fileSuffix = os.path.splitext(file)[1]
       62             if fileSuffix == '.py' or fileSuffix == '.pyc' or fileSuffix == '.swp':
       63                 print(("跳過非法文件 :[{cstart}%s{cend}]").format(cstart=PRINTBLUE,cend=PRINTCOLOR_END) % file)
       64             else:
       65                 #print('append %s' % (file))
       66                 fList.append(file)
       67     return fList
       68     '''
       69 
       70     #按修改時間獲取排序文件
       71     dir_list = os.listdir(curDir)
       72     if dir_list == None:
       73         print(("{cstart}路徑未找到{cend}").format(cstart=PRINTRED,cend=PRINTCOLOR_END))
       74         return
       75     else:
       76         dir_list = sorted(dir_list,key=lambda x: os.path.getmtime(os.path.join(curDir, x)))
       77         # print(dir_list)
       78 
       79     #過濾不需要解析的非法格式文件
       80     fList = []
       81     for file in dir_list:
       82         fileSuffix = os.path.splitext(file)[1]
       83         if fileSuffix == '.py' or fileSuffix == '.pyc' or fileSuffix == '.swp':
       84             print(("跳過非法文件 :[{cstart}%s{cend}]").format(cstart=PRINTBLUE,cend=PRINTCOLOR_END) % file)
       85         else:
       86             #print('append %s' % (file))
       87             fList.append(file)
       88 
       89     return fList
       90 
       91 def main():
       92 
       93     fileList = exploreFiles()
       94     fileNum = len(fileList)
       95 
       96     for i in range(fileNum-1):
       97         for j in range(i+1, fileNum):
       98             fNameOrg= fileList[i]
       99             fNameComp = fileList[j]
      100             orgPersionList = getPersonList(fNameOrg)
      101             compPersionList =  getPersonList(fNameComp)
      102             #delete ' ' person
      103             countOrg = len(orgPersionList) - 1
      104             countComp =  len(compPersionList) - 1
      105             print(("%s:原始人數:[{cstart}%d{cend}] 人!!!").format(cstart=PRINTRED,cend=PRINTCOLOR_END) % (fNameOrg, countOrg))
      106             print(("%s:現有人數:[{cstart}%d{cend}] 人!!!").format(cstart=PRINTGREEN_SIM,cend=PRINTCOLOR_END) % (fNameComp, countComp))
      107             calPersonDiffResult(orgPersionList, compPersionList)
      108 
      109 
      110 if __name__=="__main__":
      111   main()

       

      posted @ 2020-07-30 11:12  代碼的搬運工  閱讀(570)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 日本久久精品一区二区三区| 日本高清视频色欧WWW| 男女扒开双腿猛进入爽爽免费看| 国产福利在线观看免费第一福利| 亚洲AV日韩AV激情亚洲| 亚洲国产熟女一区二区三区| 成人午夜电影福利免费| 国产精品免费中文字幕| 少妇激情一区二区三区视频小说| 日韩少妇人妻vs中文字幕| 国产成人毛片在线视频| 色老99久久精品偷偷鲁| 日韩一区二区在线看精品| 国产午夜精品福利久久| 成人免费无码大片A毛片抽搐色欲| 少妇激情a∨一区二区三区| 国产精品推荐手机在线| a级国产乱理伦片在线观看al | 久久夜色精品国产亚洲av| 日韩av中文字幕有码| 国产真实野战在线视频| 一区二区三区在线色视频| 色婷婷日日躁夜夜躁| 国产女高清在线看免费观看| 亚洲sm另类一区二区三区| 日本高清不卡一区二区三| 精品国产一区二区三区四区| 免费国产va在线观看| 亚洲国产精品区一区二区| 亚洲中文无码av永久不收费| 乱码精品一区二区亚洲区| 日韩人妻中文字幕精品| 高清国产精品人妻一区二区| 亚洲黄色片一区二区三区| 日韩av综合中文字幕| 精品国产一区二区三区香蕉| 亚洲 欧美 综合 另类 中字| 亚洲国产成人无码电影| 丰满多毛的大隂户视频| 久色伊人激情文学你懂的| 在线高清免费不卡全码|