# a = '1,2,3,4,5' # c = list(a) # print(c) # print(r'\b') # print('\b') import random from myloging import Loging log = Loging() a = [1, 2, 3, 4] b = [[1, 2], [2, 5], [3, 6], [7, 8]] sum1 = 0 sum2 = 0 cls = [] for i in a: s = 0 for x in b: c = i in x cls.append(c) s += 1 if s == 4: if True in cls: sum1 += 1 log.info('原始网段%s包含在合并网段中' % i) else: sum2 += 1 log.error('原始网段%s没有包含在在合并网段中' % i) del cls[0:] log.info('匹配成功的个数为:%s,匹配失败的个数为:%s,原始网段为:%s' % (sum1, sum2, a))
# end = end_time.strftime("%Y-%m-%d %H:%M:%S") # minutes = seconds // 60 # second = seconds % 60 # run_time = str(minutes) + '分钟' + str(second) + '秒' # log.info('程序开始时间为:%s,结束时间为:%s,运行时间为%s' % (start, end, run_time)) # if __name__ == '__main__': # HW_test().test_hw() #创建线程 thread = [] for i in range(0, 3): t = myThread(i, i, "Thread-{}".format(i)) thread.append(t) #开启线程 start_time = datetime.datetime.now() for i in thread: i.start() for i in thread: i.join() end_time = datetime.datetime.now() seconds = (end_time - start_time).seconds start = start_time.strftime("%Y-%m-%d %H:%M:%S") end = end_time.strftime("%Y-%m-%d %H:%M:%S") minutes = seconds // 60 second = seconds % 60 run_time = str(minutes) + '分钟' + str(second) + '秒' log.info('程序开始时间为:%s,结束时间为:%s,运行时间为%s' % (start, end, run_time))