摘要: python 把list数据类型转为 pandans import pandas as pd # 示例列表数据 data_list = [ {'Name': 'Alice', 'Age': 25, 'City': 'New York'}, {'Name': 'Bob', 'Age': 30, 'Ci 阅读全文
posted @ 2023-08-05 18:51 凯帅 阅读(788) 评论(0) 推荐(0) 编辑
摘要: **添加音轨** ``` ffmpeg -i input.mp4 -i cc.MP3 -c:v copy -c:a aac -map 0:v -map 1:a -shortest output.mp4 ``` **并行合并多个视频** ``` ffmpeg -i video1.mp4 -i vide 阅读全文
posted @ 2023-06-27 18:01 凯帅 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 这个的学习主要是因为在运行目标检测的代码时总是会出现下面的错误: from Cython.Build import cythonize ModuleNotFoundError: No module named 'Cython' ERROR: Command errored out with exit 阅读全文
posted @ 2023-06-22 23:41 凯帅 阅读(66) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import cv2 import numpy as np def add_alpha_channel(img): """ 为jpg图像添加alpha通道 """ b_channel, g_channel, r_channel = cv2.split( 阅读全文
posted @ 2023-06-22 23:16 凯帅 阅读(188) 评论(0) 推荐(0) 编辑
摘要: dict排序:1.要按key值对字典排序,则可以使用如下语句: sorted(yourDict.keys()) 直接使用sorted(yourDict.keys())就能按key值对字典排序,这里是按照顺序对key值排序的,如果想按照倒序排序的话,则只要将reverse置为True即可。 2.sor 阅读全文
posted @ 2022-07-29 21:26 凯帅 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 一:前置操作 自动防故障 pyautogui.FAILSAFE = False # 默认为True,这项功能意味着:当鼠标的指针在屏幕的最左上方,程序会报错;目的是为了防止程序无法停止 停顿功能 pyautogui.PAUSE = 1 # 所有pyautogui的指令都要暂停一秒;其他指令不会停顿; 阅读全文
posted @ 2021-12-16 16:53 凯帅 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 1.html下载后乱码 直接用浏览器检查原网页的编码,然后把你下载下来的网页数据设置为网页上显示的编码,result.encoding=“网页上的编码” 2.直接获取api的json数据乱码 最近几年网页传输出现了新的br压缩方式,在请求的时候如果你的headers里面Accept-Encoding 阅读全文
posted @ 2021-02-24 22:06 凯帅 阅读(417) 评论(1) 推荐(1) 编辑
摘要: linux安装: node.js 点击后就下载了 这里 复制它的链接 使用wget下载 wget https://npm.taobao.org/mirrors/node/v12.14.1/node-v12.14.1-linux-x64.tar.xz 可以看到已经下载好了 下载的是tar.xz压缩文件 阅读全文
posted @ 2021-02-09 02:22 凯帅 阅读(279) 评论(0) 推荐(0) 编辑
摘要: requests实现session会话 import requestssession = session = requests.session() def cookie_to_cookiejar(cookies): if not hasattr(cookies, "startswith"): rai 阅读全文
posted @ 2021-01-30 13:45 凯帅 阅读(922) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver headers = { "Cookie": "JSESSIONID=xxxxxxxx", } def login(): url = "www.baidu.com" browser = webdriver.Chrome() browser. 阅读全文
posted @ 2021-01-01 15:42 凯帅 阅读(251) 评论(0) 推荐(0) 编辑