2021年12月6日

python字典转换 报错 ValueError: dictionary update sequence element #0 has length 1; 2 is required

摘要: 字符串转字典要用eval(),不要用dict() 阅读全文

posted @ 2021-12-06 15:14 阿虾 阅读(1335) 评论(0) 推荐(0) 编辑

2021年12月3日

python获取nacos配置

摘要: 下包: nacos-sdk-python github地址:https://github.com/nacos-group/nacos-sdk-python # 获取服务列表单个服务ipdef get_service_ip(self, service_name): try: SERVER_ADDRES 阅读全文

posted @ 2021-12-03 17:32 阿虾 阅读(2103) 评论(0) 推荐(0) 编辑

2021年12月2日

用subprocess执行adb shell命令怎么终止

摘要: 问题: 在程序中使用 adb shell top 命令获取 数据时,程序一直运行无法停止 原命令: subprocess.run(f'adb shell COLUMNS=200 top -d 2 | grep "com.xxx.xxx" > 123.txt', shell=True) 解决思路: l 阅读全文

posted @ 2021-12-02 21:41 阿虾 阅读(592) 评论(0) 推荐(0) 编辑

windows端搭建iOS自动化测试环境

摘要: 1、手机必须安装WebDriverAgent两种安装方式:1.通过xcode安装2.通过命令安装安装方式:https://testerhome.com/topics/7220 2、安装tidevice库, 支持python3.6+ 3、安装facebook-wda库,主要用于iOS自动化 windo 阅读全文

posted @ 2021-12-02 18:42 阿虾 阅读(685) 评论(0) 推荐(0) 编辑

解决django使用ajax跨域问题

摘要: 添加中间件 django-cors-headers pip install django-cors-headers 1、添加app INSTALLED_APPS = ( ... 'corsheaders', ... )2、添加中间件 MIDDLEWARE = [ # Or MIDDLEWARE_CL 阅读全文

posted @ 2021-12-02 18:41 阿虾 阅读(127) 评论(0) 推荐(0) 编辑

2021年11月30日

模态框的textarea滑到最底部

摘要: var height = $("#modal_content")[0].scrollHeight;$("#modal_content").scrollTop(height); 阅读全文

posted @ 2021-11-30 10:06 阿虾 阅读(38) 评论(0) 推荐(0) 编辑

2020年10月14日

django自定义主键修改多对多的数据

摘要: 1、models # 角色表class Role(models.Model): """ name: 角色名 permissions: 角色拥有的权限 """ name = models.CharField(max_length=32) permissions = models.ManyToManyF 阅读全文

posted @ 2020-10-14 01:25 阿虾 阅读(335) 评论(0) 推荐(0) 编辑

2020年7月25日

CrawlSpider一直无法进入回调函数

摘要: CrawlSpider一直无法进入回调函数的 碰到的两个坑: 1、正则表达式写的不对 start_urls = ['http://wz.sun0769.com/political/index/politicsNewest?id=1&page=1'] link = LinkExtractor(allo 阅读全文

posted @ 2020-07-25 22:05 阿虾 阅读(422) 评论(1) 推荐(0) 编辑

2020年6月15日

给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。

摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。注意空字符串可被认为是有效字符串。 class Solution: def isValid(self, s): if le 阅读全文

posted @ 2020-06-15 16:23 阿虾 阅读(3601) 评论(0) 推荐(0) 编辑

2020年6月9日

罗马数字转整型

摘要: # 将罗马数字转换成整型# class Solution:# def romanToInt(self, s):# d = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}# num = 0# for i in rang 阅读全文

posted @ 2020-06-09 13:42 阿虾 阅读(174) 评论(0) 推荐(0) 编辑

导航