会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
eliwang
学无止境的小渣渣
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
20
下一页
2022年9月19日
python利用logging模块实现根据日志级别打印不同颜色日志
摘要: logger:日志器对象,可通过logging.getLogger()方法获取 handler:处理器对象,将日志信息输出到指定位置,可通过logger.addHandler()方法进行添加 formatter:格式器对象,输出格式化日志字符串 有时候同一个应用程序有不同的日志需求,比如将error
阅读全文
posted @ 2022-09-19 19:31 eliwang
阅读(1518)
评论(0)
推荐(0)
2022年6月22日
mysql如何批量合并两个表的数据?
摘要: 一、表结构一致 允许插入重复数据 insert into 表1 select * from 表2; 不允许插入重复数据 insert into 表1 select * from 表2 where NOT EXISTS (select * from 表1 where 字段1 = 表2.字段1); 二、
阅读全文
posted @ 2022-06-22 12:21 eliwang
阅读(675)
评论(0)
推荐(0)
2022年5月12日
如何获取MongoDB数据库特定集合中的所有字段名?
摘要: 只需要两步操作: 先执行: mr = db.runCommand({ "mapreduce" : "具体集合名", "map" : function() { for (var key in this) { emit(key, null); } }, "reduce" : function(key,
阅读全文
posted @ 2022-05-12 14:07 eliwang
阅读(1974)
评论(0)
推荐(0)
selenium如何指定下载目录?
摘要: 代码: from selenium import webdriver # 导入webdriver def get_driver(): options = webdriver.ChromeOptions() # 设置谷歌浏览器的一些配置选项 options.add_argument('--window
阅读全文
posted @ 2022-05-12 13:48 eliwang
阅读(1223)
评论(0)
推荐(0)
2022年5月6日
python中pdf处理库fitz的简单使用
摘要: 一、安装fitz(需要依赖PyMuPDF) pip install fitz pip install pymupdf 二、代码演示 import os import pytesseract import cv2 as cv import fitz from PIL import Image from
阅读全文
posted @ 2022-05-06 20:47 eliwang
阅读(19291)
评论(0)
推荐(0)
2022年3月31日
python中如何利用datetime模块进行不同时区的转换?
摘要: 1、需要使用到datetime模块中的 datetime,timedelta,timezone from datetime import datetime,timezone,timedelta # 导模块 2、datetme实例的replace()方法可以给实例添加时区信息tzinfo,并返回一个新
阅读全文
posted @ 2022-03-31 18:58 eliwang
阅读(2594)
评论(0)
推荐(0)
2022年3月17日
mysql中如何根据一个表中的字段值,批量修改另一个表中的字段值
摘要: 使用连接查询来实现: update a inner join b on a.num = b.num set a.num_id = b.id; a表中的num字段和b中的num字段值相等,就将b表的id值写入a表的num_id字段
阅读全文
posted @ 2022-03-17 13:43 eliwang
阅读(2041)
评论(0)
推荐(0)
2022年3月1日
如何解决pymongo出现pymongo errors CursorNotFound: cursor id xxx not found这一问题?
摘要: 一、出现这种问题的原因 游标连接单次最大超时时间为10分钟,单次从mongo服务端获取的数据为101条或者1~16M,如果在10分钟内,未处理完获取的所有数据,则会报异常 二、解决方案 1、设置 no_cursor_timeout=True,即游标连接永不超时,需要手动关闭游标(可以利用with上下
阅读全文
posted @ 2022-03-01 13:28 eliwang
阅读(1359)
评论(0)
推荐(0)
2022年2月18日
python如何提取pdf文件图片中的文字?
摘要: 思路:利用 pymupdf+pytesseract 通过pymupdf提取pdf文件中的图片,并写入到本地,然后利用tesseract-ocr去处理 1、安装pymupdf pip install pymupdf 虽然安装的库为pymupdf,实际上调用的包名为fitz 2、示例:提取pdf文件图片
阅读全文
posted @ 2022-02-18 18:01 eliwang
阅读(3117)
评论(0)
推荐(0)
2022年2月17日
python中使用xlrd库读取xls格式excel文件
摘要: openpyxl库不能够处理xls格式excel文件,这里可以使用python自带的包xlrd来进行处理 1、导包 import xlrd 2、打开文件 df = xlrd.open_workbook("test.xls") 3、sheet操作 # 获取sheet表单名 ['sheet1','she
阅读全文
posted @ 2022-02-17 15:39 eliwang
阅读(2269)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
20
下一页
公告