上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 31 下一页
摘要: from collections import defaultdict # 将列表内的元素,根据位数合并成字典 lst = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 32769, 65536, 4294967296] dic = defaultdic 阅读全文
posted @ 2020-09-15 14:33 流年中渲染了微笑 阅读(121) 评论(0) 推荐(0)
摘要: 有时候我在工作当中需要将代码中的注释去掉 下面我们就介绍一下吧 利用python去掉java中的注释 import com.example.pojo.MethodInfo; public class MethodInfoUtil{ private static boolean quoteFlag = 阅读全文
posted @ 2020-09-15 14:32 流年中渲染了微笑 阅读(761) 评论(0) 推荐(0)
摘要: l = [[ {"id": 1, "key": 255}, {"id": 2, "key": 255}, {"id": 3, "key": 256}, {"id": 4, "key": 256}, {"id": 4, "key": 256}, ]] def getResult_1(l): res = 阅读全文
posted @ 2020-09-15 09:10 流年中渲染了微笑 阅读(1472) 评论(0) 推荐(0)
摘要: data_list = [{"a": "123", "b": "321"}, {"a": "123", "b": "321"}, {"b": "321", "a": "23"}] seen = set() new_l = [] for d in data_list: t = tuple(d.item 阅读全文
posted @ 2020-09-15 08:57 流年中渲染了微笑 阅读(657) 评论(0) 推荐(0)
摘要: <style type="text/css"> #mydiv{ height: 0px; width: 0px;/ border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 10 阅读全文
posted @ 2020-08-17 14:22 流年中渲染了微笑 阅读(312) 评论(0) 推荐(0)
摘要: import time true_time = time.mktime(time.strptime('2020-01-01 08:00:00', '%Y-%m-%d %H:%M:%S')) time_now = time.mktime(time.strptime('2020-03-01 08:00: 阅读全文
posted @ 2020-07-13 15:57 流年中渲染了微笑 阅读(135) 评论(0) 推荐(0)
摘要: 如果一个函数在内部调用自己本身,这个函数就是递归函数。 注意事项: 1,必须是自己调用自己 2,必须有一个明确的递归结束条件,即为递归出口 例子 1. 使用递归函数向控制台打印1,2,3 def num_d(num): if num == 0: return num_d(num-1) print(n 阅读全文
posted @ 2020-06-29 10:07 流年中渲染了微笑 阅读(148) 评论(0) 推荐(0)
摘要: difflib模块提供的类和方法用来进行序列的差异化比较,它能够比对文件并生成差异结果文本或者html格式的差异化比较页面,如果需要比较目录的不同,可以使用filecmp模块 1 difflib.Differ 此类比较的是文本行的差异并且产生适合人类阅读的差异结果或者增量结果,结果中各部分的表示如下 阅读全文
posted @ 2020-06-18 10:45 流年中渲染了微笑 阅读(576) 评论(0) 推荐(0)
摘要: os模块不仅提供了新建文件、删除文件、查看文件属性的操作功能,还提供了对文件路径的操作功能。但是,对于移动、复制、打包、压缩、解压文件及文件夹等操作,os模块没有提供相关的函数,此时需要用到shutil模块。shutil模块是对os模块中文件操作的补充,是Python自带的关于文件、文件夹、压缩文件 阅读全文
posted @ 2020-06-12 09:37 流年中渲染了微笑 阅读(434) 评论(0) 推荐(0)
摘要: return JsonResponse(result) 改为: return JsonResponse(result, safe=False) 阅读全文
posted @ 2020-06-05 10:15 流年中渲染了微笑 阅读(345) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 31 下一页