随笔分类 -  python

python学习
摘要:1.打开指定文件夹 2。右击a1.py,用IDLE打开(idle1) 3。右击a2.py,用IDLE打开(idle2) 4。则分别按F5运行,则两个互不影响。 5.再用IDLE1打开新程序,用IDLE2打开新程序,则仍然不会相互影响 阅读全文
posted @ 2020-12-11 07:37 myrj 阅读(1364) 评论(0) 推荐(0)
摘要:aa="adb -s {0} shell am start -n com.kuaishou.nebula/com.yxcorp.gifshow.HomeActivity".format(sjh) process = subprocess.Popen(aa,shell=True) 阅读全文
posted @ 2020-12-09 11:21 myrj 阅读(877) 评论(0) 推荐(0)
摘要:import re lb=[] with open("daaa.txt",encoding="utf8") as f: data = f.readlines() for i in data: aa=re.findall("cmp=(.*?)\(",i) if len(aa)>0 and 'kuais 阅读全文
posted @ 2020-12-09 11:15 myrj 阅读(199) 评论(0) 推荐(0)
摘要:import subprocess,time sjh="192.168.1.102:5555" aa1="adb -s {0} shell pm clear com.kuaishou.nebula".format(sjh) process = subprocess.Popen(aa1,shell=T 阅读全文
posted @ 2020-12-08 13:59 myrj 阅读(994) 评论(0) 推荐(0)
摘要:python使用re.findall时必须提前import re否则不提示错误,只是找不到结果 import re ab=re.findall('cmp=com.(.*?)/',aa) 阅读全文
posted @ 2020-12-06 11:08 myrj 阅读(380) 评论(0) 推荐(0)
摘要:import re #一定要引入,否则不提示错误,但找不到目标def jiance(sjh): aakk="adb -s {0} shell dumpsys activity activities".format(sjh) aak="adb -s {0} shell am start -n com. 阅读全文
posted @ 2020-12-05 21:18 myrj 阅读(589) 评论(0) 推荐(0)
摘要:aakk="adb devices" aakk="adb shell dumpsys window w |findstr \/ |findstr name=" zh=[] lx=[] p = subprocess.Popen(aakk, shell=True, stdout=subprocess.P 阅读全文
posted @ 2020-12-04 17:38 myrj 阅读(74) 评论(0) 推荐(0)
摘要:import datetime,time def jsyx(aa1,aa2): jssj=datetime.datetime.strptime(str(datetime.date.today()+datetime.timedelta(days=1))+" 05:48:00",'%Y-%m-%d %H 阅读全文
posted @ 2020-12-04 10:38 myrj 阅读(655) 评论(0) 推荐(0)
摘要:#利用ADB DEVICES结果判断指定手机是否正常连接,如果为offline,则adb disconnect sjh;adb connect sjh#如果没有,则执行adb connect sjhdef jianchaad(sjh): aakk="adb devices" zh=[] lx=[] 阅读全文
posted @ 2020-12-04 07:16 myrj 阅读(1402) 评论(0) 推荐(0)
摘要:import time, threading, copy import win32api, win32con import win32gui import win32gui def zhaojb(aa): mu=0 jh=[] hwnd_title = dict() def get_all_hwnd 阅读全文
posted @ 2020-12-02 13:52 myrj 阅读(1239) 评论(1) 推荐(0)
摘要:点击“USB线”一栏中的“刷新设备列表”按钮,随后设备序列号会显示出来; ·点击“获取设备IP”,随后在“无线”一栏中会显示设备的IP地址; ·点击“启动adbd”,这时候可以拔下USB线了; ·点击“无线”一栏中的“无线连接”; ·再次点击“USB线”一栏中的“刷新设备列表”按钮,在“设备序列号” 阅读全文
posted @ 2020-12-01 05:46 myrj 阅读(4669) 评论(0) 推荐(0)
摘要:#import pymssql from datetime import datetime import pyodbc import os current_dir = os.path.abspath(os.path.dirname(__file__))+"\\" cnxn = pyodbc.conn 阅读全文
posted @ 2020-11-23 08:57 myrj 阅读(313) 评论(0) 推荐(0)
摘要:ModuleNotFoundError: No module named 'cv2' 解决方法: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python pip install -i https://pypi.tun 阅读全文
posted @ 2020-11-19 21:20 myrj 阅读(3703) 评论(0) 推荐(0)
摘要:线程分别调用两个函数,函数名后不能带括号 sp1=Thread(target=denglu)sp2=Thread(target=sjkz)sp2.start()sp1.start()sp2.join()sp1.join() 如果带了括号,只能运行SP1.不能运行SP2 阅读全文
posted @ 2020-11-19 20:33 myrj 阅读(67) 评论(0) 推荐(0)
摘要:清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 华中理工大学:http://p 阅读全文
posted @ 2020-11-18 14:52 myrj 阅读(666) 评论(0) 推荐(0)
摘要:import pymysql # 打开数据库连接 conn = pymysql.connect( host="98.159..",user="sa",password="sa",database="mysjk", charset="utf8") print(conn) print(type(conn 阅读全文
posted @ 2020-11-09 19:47 myrj 阅读(67) 评论(0) 推荐(0)
摘要:aa={"a":2,"b":1} for i in range(10): aa["a"]=aa["a"]-i print(aa["a"]) try: ab=aa["c"]-1 except KeyError: #记录特定异常 print("没有相应的关键") try: print(ab) excep 阅读全文
posted @ 2020-10-26 07:18 myrj 阅读(80) 评论(0) 推荐(0)
摘要:a={} a={"a":1,"b":2,"c":3,"d":4} print(a) print(a.items()) print(a.values()) print(list(a.items())) #以列表形式显示字典所有的键 print(list(a.values())) #以列表形式显示字典所 阅读全文
posted @ 2020-10-19 16:17 myrj 阅读(6881) 评论(0) 推荐(0)
摘要:dzkuaa={}#类似{“张三":2,"李四":3} for i in range(23): ming=bj[i] if dzkuaa.get(ming)==None:#从字典中检索姓名,如果为None则没有 #该名,则其值设为1.相反则原有值加1 dzkuaa[ming]=1 else: dzk 阅读全文
posted @ 2020-10-19 05:17 myrj 阅读(2637) 评论(0) 推荐(0)
摘要:d:\python37\scripts\>pip install pypiwin32 阅读全文
posted @ 2020-10-13 11:12 myrj 阅读(960) 评论(0) 推荐(0)