1)取异或,然后计算1的个数 class Solution: def hammingDistance(self, x: int, y: int) -> int: t = x^y count = 0 while t: count += 1 t = t& t-1 return count ...
分类:
编程语言 时间:
2021-06-11 19:07:12
阅读次数:
0
#python之模块py_compile用法(将py文件转换为pyc文件);二进制文件,是由py文件经过编译后,生成的文件. #办法一: import py_compile #加r前缀进行转义 py_compile.compile(r'D:\test.py')#py文件完整的路径. 办法二: #cm ...
分类:
编程语言 时间:
2021-06-11 19:06:54
阅读次数:
0
打开文件 with open with open(file_name,access_mode,encoding) for line in f.readlines(): print(line.strip()) #调用read()会一次性读取文件的全部内容,如果文件有10G,内存就爆了,所以,要保险起见 ...
分类:
编程语言 时间:
2021-06-11 18:52:26
阅读次数:
0
本文首发于:行者AI 我们在做自动化测试的时候,大家都是希望自己写的代码越简洁越好,代码重复量越少越好。那么,我们可以考虑将request的请求类型(如:Get、Post、Delect请求)都封装起来。这样,我们在编写用例的时候就可以直接进行请求了。 1. 源码分析 我们先来看一下Get、Post、 ...
分类:
编程语言 时间:
2021-06-11 18:51:28
阅读次数:
0
yaml文件读取: def read_yaml(): with open("config.yaml", encoding='utf-8') as f: data = yaml.load(f.read(), Loader=yaml.FullLoader) print(data) ...
分类:
编程语言 时间:
2021-06-11 18:50:54
阅读次数:
0
v-model:双数据绑定 <template> <div id="app"> <input type="text" v-model="name"> <p>{{name}}</p> </div> </template> <script> export default { data() { retur ...
分类:
其他好文 时间:
2021-06-11 18:49:57
阅读次数:
0
getpass.getpass File "C:/秦瑞/测试项目/chk_9/dateTimeTool.py", line 19, in dtTstamp second = getpass("输入需要转换成str类型日期时间的时间戳: ")TypeError: 'module' object is ...
分类:
其他好文 时间:
2021-06-11 18:48:03
阅读次数:
0
新建文本文档,添加以下内容,改后缀名为.reg Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.md] @="MarkdownFile" "PerceivedType"="text" "Content Type"="text/plai ...
分类:
其他好文 时间:
2021-06-11 18:38:13
阅读次数:
0
最近在做软件杯的项目,想做一个人脸识别、对比的登录,当相似度超过某个数值时通过登录验证。 json数据: {'error_code': 0, 'error_msg': 'SUCCESS', 'log_id': 9975359915559, 'timestamp': 1623377294, 'cach ...
分类:
编程语言 时间:
2021-06-11 18:36:07
阅读次数:
0
在实体类中添加@TableId注解: @Data public class DxApplication { @TableId(type = IdType.AUTO) private Long id; private String name; private Integer sort; } 在navi ...
分类:
其他好文 时间:
2021-06-11 18:35:34
阅读次数:
0