- 博客(4)
- 收藏
- 关注
原创 Python adb
obj = subprocess.Popen("adb version", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=True)shell=True是必须的,如果你想操控adb。universal_newlines=True,如果你想使用"\n",这个属性是必须的。...
2021-11-25 16:13:16
615
原创 Python基础操作
如何注释#单行注释"""多行注释"""'''多行注释'''import一个包以后,如何知道这个包的接口import sysprint (dir(sys))如何读取参数使用sys.argvimport sys"""print ('length:', len(sys.argv), '!!!')print ('value:', str(sys.argv))print ("hello 'world'")"""test=sys.argv[1]+
2021-11-23 18:33:46
1097
原创 Python读取图片内容并进行修改
在上一篇文章中,生成了三张图片,现在针对其中一张进行图片的读取和数据的转换。其中.convert('L')很重要,读出来的像素值是一个数组,包含RGB的分量值,如果不进行转换的话,直接与220去比较,会报错。from PIL import Imageimport matplotlib.pyplot as pltimport numpy as npimage = Image.open('D:/python/generate/mixRowColumnColor.png').convert('L'
2021-11-21 01:38:48
3763
原创 Python画图
因为工作中需要用到一些特殊的图卡,使用windows自带的画图工具不好实现,将python生成图卡的学习记录保留在这里。import randomfrom PIL import Image, ImageDraw, ImageFilterdef rndColor(): return (random.randint(128, 255), random.randint(128, 255), random.randint(128, 255))def leftColor(): ret
2021-11-21 00:33:59
1732
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人