随笔 - 633,  文章 - 0,  评论 - 13,  阅读 - 48万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  uiautomator2

python项目目录添加到python环境变量中
摘要:vim ~/.bash_profile 在.bash_profile中添加一下两行 PYTHONPATH=/mnt/udisk/project/myproject/wanwenyc export PYTHONPATH 修改完成执行以下命令生效 #source ~/.bash_profile 阅读全文
posted @ 2020-10-03 22:21 大话人生 阅读(1187) 评论(0) 推荐(0) 编辑
python 安装虚拟环境
摘要:1. pip install virtualenv 2.pip install virtualenvwrapper-win 注: linux下运行pip install virtualenvwrapper 阅读全文
posted @ 2020-08-17 09:07 大话人生 阅读(140) 评论(0) 推荐(0) 编辑
安装xadmin2.0命令
摘要:pip3 install https://codeload.github.com/sshwsfc/xadmin/zip/django2 -i https://pypi.douban.com/simple/或者 pip install https://codeload.github.com/sshws 阅读全文
posted @ 2020-08-01 08:53 大话人生 阅读(195) 评论(0) 推荐(0) 编辑
django xadmin 根据是否管理员 设置只读字段
摘要:#指导教程class GuideHelpXadmin(object): all_zi_duan = ["id", "add_time", "update_time"] list_display = ['guide_project', 'go_to'] # 定义显示的字段 list_filter = 阅读全文
posted @ 2020-07-24 15:37 大话人生 阅读(489) 评论(0) 推荐(0) 编辑
django model关联保存
摘要:class GuideHelp(models.Model): guide_project = models.CharField(max_length=100, default="", null=True, blank=True, verbose_name=u"指导文件名称") guide_file 阅读全文
posted @ 2020-07-24 15:01 大话人生 阅读(365) 评论(0) 推荐(0) 编辑
python 将字符串作为脚本运行
摘要:def exec_code(): LOC = """ def factorial(num): fact=1 for i in range(1,num+1): fact = fact*i return fact print(factorial(5)) """ exec(LOC) exec_code() 阅读全文
posted @ 2020-07-20 16:14 大话人生 阅读(641) 评论(0) 推荐(0) 编辑
django 视图中异步执行python脚本
摘要:python脚本:autoStaticRDMTask.py # import os, django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wanwenyc.settings") django.setup() # # 独运行某一个py文件时会 阅读全文
posted @ 2020-07-17 10:27 大话人生 阅读(1401) 评论(0) 推荐(0) 编辑
python 异步执行python脚本
摘要:async_call.py from threading import Thread def async_call(fn): def wrapper(*args, **kwargs): Thread(target=fn, args=args, kwargs=kwargs).start() retur 阅读全文
posted @ 2020-07-17 09:46 大话人生 阅读(1652) 评论(0) 推荐(0) 编辑
django 筛选不等于的内容
摘要:myapps = App.objects.filter(name != ''))这种写法是不对的,正确写法是: from django.db.models import Q myapps = App.objects.filter(~Q(name= '')) 阅读全文
posted @ 2020-07-16 16:15 大话人生 阅读(6424) 评论(0) 推荐(0) 编辑
python 字典和json树形输出
摘要:import json a = {}print(json.dumps(a, indent=1))#indent=1代表字节点比父节点前多几个空格 阅读全文
posted @ 2020-07-04 09:07 大话人生 阅读(696) 评论(0) 推荐(0) 编辑
cannot import name 'UnidentifiedImageError'
摘要:更换pillow的版本pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow==4.0.0 阅读全文
posted @ 2020-07-04 07:12 大话人生 阅读(2563) 评论(0) 推荐(0) 编辑
pycharm 解决 “ invalid authentication data”
摘要:0.先将pycharm中Settings中的“Version Control” 中无效的Git删除,并且点击OK,确定删除(如果没有,则不需要删除); 1.登录到 “https://github.com/settings/tokens”,将原有的token清空,关闭pycharm,重启pycharm 阅读全文
posted @ 2020-06-21 10:03 大话人生 阅读(3950) 评论(0) 推荐(0) 编辑
python解决编码时,单鞋杠变为双斜杠问题
摘要:a = "1D0\x00" b = a.encode("gbk").decode("unicode_escape") #将字符串先编码后解码,解决单斜杠,变为双斜杠问题 阅读全文
posted @ 2020-06-16 14:18 大话人生 阅读(1242) 评论(0) 推荐(0) 编辑
adb 无限连接手机
摘要:1.usb先连接手机与电脑; 2.adb devices :检测到手机; 3.adb tcpip 5555 :打开5555端口 4.拔掉数据线 5.adb connect 192.168.1.100:5555 其中192.168.1.100为你手机的实际IP地址 6.adb devices :查看是 阅读全文
posted @ 2020-06-12 22:03 大话人生 阅读(335) 评论(0) 推荐(0) 编辑
python uiautomator2 安装
摘要:1.安装: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple uiautomator2 pip install -i https://pypi.tuna.tsinghua.edu.cn/simple weditor 2.使用: pytho 阅读全文
posted @ 2020-06-07 19:51 大话人生 阅读(949) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示