随笔分类 -  Python

1 2 下一页

could not find a version that satisfies the requirement PIL.(form versions:)
摘要:pip install Pillow 阅读全文

posted @ 2021-02-18 09:15 不知所以随风飘动 阅读(83) 评论(0) 推荐(0) 编辑

重写csv某行
摘要:import csv to_path="1.csv" to_path_="1的备份最终用这个文件.csv" with open(to_path, 'r') as f1: read_it = csv.reader(f1) show_rows = [row for row in read_it] for 阅读全文

posted @ 2020-08-28 10:09 不知所以随风飘动 阅读(270) 评论(0) 推荐(0) 编辑

正确的打包方式
摘要:本文禁止转载 首先cd 到你的项目所在目录中 打开cmd,如果没有安装 pipenv ,就先安装这个。 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pipenv 安装好之后:第一步:因为我的版本问题,所以有 uninstall 这 阅读全文

posted @ 2020-08-26 23:53 不知所以随风飘动 阅读(343) 评论(0) 推荐(0) 编辑

【转】pyqt基本控件
摘要:原文链接:https://www.cnblogs.com/linyfeng/p/11223711.html 本文主要介绍PyQt界面实现中常用的消息弹出对话框、提供用户输入的输入框、打开文件获取文件/目录路径的文件对话框。学习这三种控件前,先想一下它们使用的主要场景: 1、消息弹出对话框。程序遇到问 阅读全文

posted @ 2020-08-26 14:04 不知所以随风飘动 阅读(251) 评论(0) 推荐(0) 编辑

eric6 +pyqt+anaconda ===pyinstaller pyzbar pyttsx3 打包踩坑记录
摘要:本文禁止转载 版本:Anaconda3-4.4.0-Windows-x86_64.exe 版本:pyinstaller4.0 版本:eric6 关键出问题的库 from pyzbar import pyzbar import pyttsx3 先总结一下: 打包程序之前,最好就是 先直接 pyinst 阅读全文

posted @ 2020-08-25 22:37 不知所以随风飘动 阅读(509) 评论(0) 推荐(0) 编辑

pyinstaller 安装报错解决
摘要:版本:Anaconda3-4.4.0-Windows-x86_64.exe 打开cmd 直接 pip install pyinstaller 报错。 在下载离线的pyinstaller之后,安装还是不行。 最后,我打开了Anaconda prompt ,在里面再次尝试 pip install pyi 阅读全文

posted @ 2020-08-25 17:38 不知所以随风飘动 阅读(934) 评论(0) 推荐(0) 编辑

【转】python 中文乱码问题
摘要:参考链接https://blog.csdn.net/joyfixing/article/details/79971667 该文章挺详细的, 复制过来了,读者可以去看原文。 阅读全文

posted @ 2020-08-23 14:23 不知所以随风飘动 阅读(144) 评论(0) 推荐(0) 编辑

pthon 解释器编码改为utf-8
摘要:仅更改 本次 某个程序编码: 程序前加代码: import sys reload(sys) sys.setdefaultencoding('utf8') 一直保持更改: 在 python的Lib\site-packages文件夹下新建一个sitecustomize.py,然后重启解释器 sitecu 阅读全文

posted @ 2020-08-23 10:49 不知所以随风飘动 阅读(193) 评论(0) 推荐(0) 编辑

opencv python2.7
摘要:在这里下载 https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv python2.7 下载 opencv_python‑2.4.13.7‑cp27‑cp27m‑win_amd64.whl 如果在上述链接里找不到该版本,点我下载 解压到D:\然后: pi 阅读全文

posted @ 2020-08-23 02:42 不知所以随风飘动 阅读(1422) 评论(0) 推荐(0) 编辑

pyzbar 安装报错问题
摘要:本文禁止转载 解决办法: pip install enum34 --upgrade --ignore-installed pip install pyzbar 阅读全文

posted @ 2020-08-23 01:26 不知所以随风飘动 阅读(702) 评论(0) 推荐(0) 编辑

【转】判断字符串是否是中文
摘要:原文链接:https://www.jb51.net/article/153637.htm # 检验是否含有中文字符 def isContainChinese(s): for c in s: if ('\u4e00' <= c <= '\u9fa5'): return True return Fals 阅读全文

posted @ 2020-08-22 00:26 不知所以随风飘动 阅读(329) 评论(0) 推荐(0) 编辑

字典取后半部分
摘要:本文禁止转载 a={"1":2,"e":"r","g":"5","3":2,"2":"r"} b=a a=list(a.keys()) a.reverse() a=a[:-2] a.reverse() c={} for i in a: c[i]=b[i] a=c print(a) 阅读全文

posted @ 2020-08-21 18:36 不知所以随风飘动 阅读(142) 评论(0) 推荐(0) 编辑

当前时间转为整型
摘要:本文禁止转载 1 import time 2 import datetime 3 get_now = datetime.datetime.now() #获取当前时间 4 to_str=datetime.datetime.strftime(get_now,'%Y-%m-%d %H:%M:%S') #转 阅读全文

posted @ 2020-08-21 10:47 不知所以随风飘动 阅读(563) 评论(0) 推荐(0) 编辑

每隔2秒执行一次
摘要:import time def xm(h,m,s): return h*3600 + m*60 + s set_xm_time = xm(0,0,2) while 1==1: time.sleep(set_xm_time) print("醒了") 阅读全文

posted @ 2020-08-20 16:54 不知所以随风飘动 阅读(309) 评论(0) 推荐(0) 编辑

字符串倒叙
摘要:kkkyyg = '129479asdaf/' lhgt = list(kkkyyg) lhgt.reverse() ahaha=''.join(lhgt) print(ahaha) 阅读全文

posted @ 2020-08-20 15:54 不知所以随风飘动 阅读(160) 评论(0) 推荐(0) 编辑

脚本什么的都对,但是执行就报错,别急,纠错来了
摘要:解决方法 1.module copy ???????????? 忽然想起来 自己 建了一个 copy.py 文件,python内置有这个文件,所以冲突!! 把自己建的 copy.py 改个名字就好了。 阅读全文

posted @ 2020-08-20 00:04 不知所以随风飘动 阅读(213) 评论(0) 推荐(0) 编辑

【转】python 时分秒转秒 秒转时分秒
摘要:原文链接:https://www.cnblogs.com/gayhub/p/6154707.html 受到Unix时间戳的启发,我发现时间转成秒数后会非常好处理,在程序当中不再是以字符串的形式处理,不管时间的加减还是获取随机的时间点都变得非常方便, 如果有需要,也很容易转换成需要的时间格式。 一:时 阅读全文

posted @ 2020-08-19 20:14 不知所以随风飘动 阅读(582) 评论(0) 推荐(0) 编辑

[转]Python 获取当前时间
摘要:原文链接:https://www.cnblogs.com/xiaoxiaoweng/p/10966220.html 1.先导入库:import datetime 2.获取当前日期和时间:now_time = datetime.datetime.now() 3.格式化成我们想要的日期:strftime 阅读全文

posted @ 2020-08-19 19:42 不知所以随风飘动 阅读(185) 评论(0) 推荐(0) 编辑

pychram 使用pip 安装包
摘要:按下 Alt+F12 调出terminal, 然后: pip install X pip3 install X python -m pip install X 有时候安装不上,可能资源在某个站上,需要 跳起来 之后,再pip 跳不起来就加源 pip install -i https://pypi.t 阅读全文

posted @ 2020-08-18 17:42 不知所以随风飘动 阅读(182) 评论(0) 推荐(0) 编辑

在1-12 区间内 一次性 产生 无重复 的12个 随机数
摘要:1 sjs=[] #存放 产生的 随机数 结果 2 def wuchongfushuijishu(sl): 3 sj1=random.randint(1,12) # 生成一个 1-12 范围内的 随机数, 4 if(sl<=12): # 判断目前有没有12个随机数 5 if(sj1 not in s 阅读全文

posted @ 2020-08-15 09:39 不知所以随风飘动 阅读(1166) 评论(0) 推荐(0) 编辑

1 2 下一页

导航

统计

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