上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页
摘要: rocketmq-python 是一个基于 rocketmq-client-cpp 封装的 RocketMQ Python 客户端。 一、Producer #coding:utf-8import json from rocketmq.client import Producer, Message p 阅读全文
posted @ 2021-12-16 16:05 eliwang 阅读(4242) 评论(0) 推荐(0) 编辑
摘要: 对xlsx文件和csv文件进行相互转换,我们可以借助pandas来实现 一、安装pandas pip3 install pandas 二、xlsx文件转csv文件 import pandas as pd data = pd.read_excel('test.xlsx',index_col=0) # 阅读全文
posted @ 2021-12-02 12:09 eliwang 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: 我们测试下3种插入操作方式的性能情况(以10000次为例): 1、每条数据都进行execute和commit 2、多次执行exectue,最后commit 3、使用executemany执行1次,然后commit1次 示例: # coding:utf-8 import time import pym 阅读全文
posted @ 2021-11-19 19:49 eliwang 阅读(263) 评论(0) 推荐(1) 编辑
摘要: pdfplumber不仅可以解析提取pdf文件中的文本,还可以提取表格 一、安装 pip3 install pdfplumber 二、使用 # coding:utf-8 import pdfplumber with pdfplumber.open('./test.pdf') as pdf: # 遍历 阅读全文
posted @ 2021-11-19 19:15 eliwang 阅读(3358) 评论(0) 推荐(0) 编辑
摘要: 我们经常在调用第三方库中的一些方法时,会提示该方法已弃用之类的warning,虽然能执行,但是看起来不太美观,如何过滤这些警告提示呢? warnings模块,调用warnings.filterwarnings()方法 from warnings import filterwarnings filte 阅读全文
posted @ 2021-11-15 13:58 eliwang 阅读(3010) 评论(0) 推荐(0) 编辑
摘要: 一、从命令行创建一个新的仓库 1、创建一个说明文件 touch README.md 2、首先使该目录成为git可以管理的目录 git init 3、添加所有文件到本地暂存区 git add . #(不要忘了后面的点".",表示所有文件及目录) # git add README.md 表示将 READ 阅读全文
posted @ 2021-11-05 14:12 eliwang 阅读(2160) 评论(0) 推荐(0) 编辑
摘要: 出现类似问题,是这个字节超出了utf-8的表示范围,出现了解码错误 解决方案:设置encoding = 'ISO-8859-1' 比如: with open('./xxx.txt',encoding='ISO-8859-1') as f: print(f.read()) 阅读全文
posted @ 2021-10-26 17:44 eliwang 阅读(4656) 评论(0) 推荐(0) 编辑
摘要: zipfile包是python中用来处理zip文件压缩和解压缩的 一、导包 import zipfile 二、zipfile.ZipFile类 z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,compressle 阅读全文
posted @ 2021-10-26 16:17 eliwang 阅读(3782) 评论(0) 推荐(0) 编辑
摘要: python脚本中可以通过PyExecJS库来处理js代码(可参考:excejs的使用),但是性能并不高,很难满足高并发的要求 Node.js是一个Javascript运行环境(runtime)。它对Google V8引擎进行了封装,使用事件驱动, 非阻塞I/O 模型而得以轻量和高效,能够方便地搭建 阅读全文
posted @ 2021-10-07 02:51 eliwang 阅读(780) 评论(0) 推荐(0) 编辑
摘要: 使用scrapy-splash,可以模拟浏览器来加载js,因此可以用来处理那些使用js动态加载的页面。 scrapy-splash组件的使用: 1、借助docker启动splash服务 docker的安装及配置镜像加速器 可参照https://www.cnblogs.com/eliwang/p/15 阅读全文
posted @ 2021-10-06 18:32 eliwang 阅读(658) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页