随笔分类 -  Python

摘要:作为 python 特定的GUI界面,是一个图像的窗口,tkinter是python 自带的,可以编辑的GUI界面,直接import即可使用 这是程序效果图 代码如下: import tkinterimport datetimeimport requestsfrom bs4 import Beaut 阅读全文
posted @ 2020-05-14 15:28 lihuimin222 阅读(688) 评论(0) 推荐(0)
摘要:# hello3.pyimport hello4person = {'Alice': 13, 'Bob': 35, 'May': 56, 'Lin': 29}body_name = ['head', 'body', 'hand', 'leg', 'foot']# 找出想要的字符串def number 阅读全文
posted @ 2020-04-13 19:00 lihuimin222 阅读(389) 评论(0) 推荐(0)
摘要:import datetime, os, timedef dif_num(a, b): total_str = b - a print("差", total_str) return total_strdef get_time(): now_time = datetime.datetime.now() 阅读全文
posted @ 2020-04-13 16:37 lihuimin222 阅读(260) 评论(1) 推荐(0)
摘要:批量修改文件名import ospath = 'F:\\PICTURE'i = 1#对目录下的文件进行遍历for file in os.listdir(path):#判断是否是文件 if os.path.isfile(os.path.join(path,file))==True:#设置新文件名,%5 阅读全文
posted @ 2019-09-10 10:29 lihuimin222 阅读(256) 评论(0) 推荐(0)
摘要:最近在测试app的时候经常要查看Android设备的基本信息,app的相关信息和重复性操作 使用adb可以直接使用命令操作,但是不太方便,我用Python的wx做了一个exe的小工具,方便在window下运行 1.代码如下 2.使用pycharm的Terminal下命令打包成exe(前面讲过) 3. 阅读全文
posted @ 2019-07-20 11:32 lihuimin222 阅读(427) 评论(0) 推荐(0)
摘要:1.安装pyinstaller 2.打开终端,输入命令pyinstaller -F -w gui.py -F:将所有库文件打包成一个exe -w:隐藏黑色控制台窗口 3.完成后在当前路径的dist文件夹下为生成的exe文件,无需安装Python环境,直接可以在windows环境下双击运行了 阅读全文
posted @ 2019-06-29 11:08 lihuimin222 阅读(2489) 评论(1) 推荐(0)
摘要:因为想使用pillow实现图片对比功能,发现死活安装不上 1.pycharm默认安装的pip包是10.0.1,安装pillow的时候一直提示版本需要升级。 那么按照命令python -m pip install --upgrade pip 进行升级,结果发现还是不行 先把pip先删掉,重新在cmd中 阅读全文
posted @ 2019-05-20 14:36 lihuimin222 阅读(2328) 评论(0) 推荐(0)