摘要: 大规模Windows环境下,采用Nginx反向代理服务后,操作系统会产生较多TIME_WAIT的TCP(Transmission Control Protocol)连接,操作系统默认TIME_WAIT的TCP连接回收时间是4分钟,TCP默认动态端口范围为开始端口49152,结束端口65535。这样会 阅读全文
posted @ 2020-05-30 15:21 雅虎跳跳 阅读(2239) 评论(0) 推荐(0) 编辑
摘要: 一个列表中全是自然数,是无序的,计算这个列表中最大长度的连续自然数。比如[1,5,7,9,12,17,,6,6],返回结果为 [5,6,7] def get_longest_num(list1): longest_num = [] long_tmp = [] flag = True longth = 阅读全文
posted @ 2020-04-24 12:41 雅虎跳跳 阅读(294) 评论(0) 推荐(0) 编辑
摘要: # coding:utf8 import time #解法一 def leapyear(n): return True if (n % 4 == 0 and n % 100 != 0) or n % 400 == 0 else False days = [31, 28, 31, 30, 31, 30 阅读全文
posted @ 2020-04-22 09:05 雅虎跳跳 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之间时高于40万元的部分,可提成3%;60万到100万 阅读全文
posted @ 2020-04-22 08:52 雅虎跳跳 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 匹配双字节(包含汉字,中文标点等):[^\x00-\xff]匹配汉字: [\u4e00-\u9fa5] 阅读全文
posted @ 2020-04-15 20:51 雅虎跳跳 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 64、手动抛出异常raise 用raise语句来引发一个异常。 在try语句中,捕捉到了异常,但是又想重新引发它(传递异常),可以使用不带参数的raise语句即可: try: for i in range(4): if(i<100): raise ValueError("数字小于100") prin 阅读全文
posted @ 2020-04-13 10:58 雅虎跳跳 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 60、Python3中的encode('unicode-escape')和encode('raw_unicode_escape') 若某字符串的内容为bytes形式, 如 a = '\xe7\x8e\x8b\xe8\x80\x85\xe5\x86\x9c\xe8\x8d\xaf' 可使用encode 阅读全文
posted @ 2020-04-12 23:21 雅虎跳跳 阅读(448) 评论(0) 推荐(0) 编辑
摘要: // 前瞻:exp1(?=exp2) 查找exp2前面的exp1// 后顾:(?<=exp2)exp1 查找exp2后面的exp1// 负前瞻:exp1(?!exp2) 查找后面不是exp2的exp1// 负后顾:(?<!exp2)exp1 查找前面不是exp2的exp1(?:)表示非捕获分组,和捕 阅读全文
posted @ 2020-04-12 13:27 雅虎跳跳 阅读(134) 评论(0) 推荐(0) 编辑
摘要: # -*-coding:UTF8-*- import os import json def find_all_files(dirpath): dirlist = os.listdir(dirpath) for i in dirlist: curpath = dirpath + os.sep + i 阅读全文
posted @ 2020-04-06 23:32 雅虎跳跳 阅读(654) 评论(0) 推荐(0) 编辑
摘要: # -*-coding:UTF8-*- import os import json def find_all_text_in_dir_files(dirpath, des_text="CURDIR"): dirlist = os.listdir(dirpath) textfiletypes = [' 阅读全文
posted @ 2020-04-06 23:31 雅虎跳跳 阅读(153) 评论(0) 推荐(0) 编辑