解决宝塔 tomcat启动异常 /www/server/tomcat/bin/jsvc:No such file or directory 提示缺少 jsvc 文件方法一: 直接使用编译好的文件下载: https://wwi.lanzouo.com/iao2Izbextc下载解压后 直接拖进 /www/server/tomcat/bin/目录下然后修改此文件的权限 chmod 777 jsvc再启动tomcat 成功
pyppeteer 坑:page.on(‘response was never awaited Enable tracemalloc to get the object allocation trac 异常回顾:python版本:3.9pyppeteer版本:0.2.6pyee版本:8.2.2实现响应拦截的功能async def intercept_response(response): # resourceType = response.request.resourceType # print(resourceType) if 'get-list' in response.url: print(response.url) # print(
pyppeteer 坑:page.on(‘response was never awaited Enable tracemalloc to get the object allocation trac 异常回顾:python版本:3.9pyppeteer版本:0.2.6pyee版本:8.2.2实现响应拦截的功能async def intercept_response(response): # resourceType = response.request.resourceType # print(resourceType) if 'get-list' in response.url: print(response.url) # print(
error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools“:解决方案 我的是 win10系统下载官方的这个 Microsoft Build Tools 2015安装好直接安装pip就好了
爬虫中遇到POST请求中表单数据出现重复参数时的处理方式 如下图 form data中出现的参数 disclosureSubtype[] needFields[] ,出现了至少两次那么爬虫中模拟请求时如何使用呢:一下两种方式均已测试可用(使用的python测试)格式一data = [ ('disclosureSubtype[]', '9503-1004'), ('disclosureSubtype[]', '9504-2106'), ('page', '0'), ('companyCd', ''), ('isNewThree',.
apscheduler 遇到的问题 报错信息:D:\AMyData\Codes\Python\MyBlog\blog_services\venv\lib\site-packages\apscheduler\util.py:95: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https:
SQLAlchemy建表 更新时间随时间戳自动更新 update_time = db.Column(db.TIMESTAMP, nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) # 记录的更新时间如果想要根据当前时间戳更新生效 需要有这个属性server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')...
MySQL设置自动更新时间戳,仅insert时更新 update时不更新 创建一行数据时自动生成时间戳,后续更新该行数据时时间戳不变将字段设置成timestamp类型,同时默认值设置成 CURRENT_TIMESTAMP`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
python 字典 get() 参数问题 字典经常用 但是还是第一次遇到这个问题,看来时第一次用这个参数字典对象去get其中不存在的key 时 默认返回None 是default 参数的默认值 如下:dict().get('recordTimes', default=None)当我遇到不存在key 时不返回None 时咋办,第一感觉就是改 default对应的值但是 这个地方有个坑dict().get('recordTimes', default='我想要的值')这是会报错Traceback (most recent cal
python .py文件编译 .pyd 待编译源文件: math_code.pydef fact(n): if n==0 or n==1: return 1 else: return n*fact(n-1)def fibo(n): if n==0 or n==1: return 1 else: return fibo(n-1)+fibo(n-2)def dicho(f, a, b, eps): assert f(a)*f(b) <
使用pycharm 将代码转换大小写 写代码时一般都将常量名写成大写便于区分但是由于本人英语垃圾 只认识英文小写 所以命名时很难直接写出大写的常量由于懒就脑中浮现能不能使用工具将小写字母转换成大写,于是就查到了以下方法:一、选中要转换的字母二、点击pycharm的编辑菜单然后就得到了如下结果...
利用openpyxl 将excel xlsx文件中数据转为python 字典格式数据 废话少说 直接上代码python 3.7.9import openpyxlxlsxPath = './test.xlsx'# 第一步打开工作簿wb = openpyxl.load_workbook(xlsxPath)# 第二步选取表单sheet = wb.active# 按行获取数据转换成列表rows_data = list(sheet.rows)# 获取表单的表头信息(第一行),也就是列表的第一个元素titles = [title.value for title in rows_
celery 异常 strategy = strategies[type_] KeyError: ‘celery_task.tasks1.filter_befor_save‘ 使用的环境python: 3.7.9celery : 5.0.5异常信息:具体的报错原因暂时没找到,不过经历了半天的时间在网上找到了很多种方法,但是只有这一种有效当然是否是适合其他版本,我这里没有测试,你可以试试,我这只是自己的一个记录解决方法:在创建celery对象时 添加参数 include 参数celery对象创建 在 init.py 文件中from celery import Celeryfrom app import app # 配合flask一起使用的话
python 爬虫 自动识别相应编码 res = s.get(urlTemp, headers=headers, timeout=5)res.encoding = res.apparent_encoding# html_ = etree.HTML(res.content.decode('gbk'))print(res.text)
python 汉字转拼音 获取首字母 方式一、通过第三方库import pinyinprint(pinyin.get('汉字'))# 获取首字母,可将中文字符串转为中文列表 然后获取每一个汉字的拼音字符串取第一个然后拼接即可print(pinyin.get('汉'))[0]方式二、通过编码对比def single_get_first(unicode1): str1 = unicode1.encode('gbk') try: ord(str1) return str1.