随笔分类 -  Python-Basic

摘要:参考链接: https://blog.51cto.com/u_15127678/4350010 阅读全文
posted @ 2023-06-13 11:53 代码诠释的世界 阅读(100) 评论(0) 推荐(0) 编辑
摘要:一、场景 由于网上下载了个zip文件,想解压,发现需要密码,但是又忘记了下载的来源 二、方法 暴力破解:完全不知道密码是啥,只能以组合密码的方式进行遍历,如果知道可能得密码组合会快很多,如纯数字,纯字母等 字典破解:比如你知道可能得密码是多少,但是可能有很多种组合。 本质上都是对可能密码组合的遍历 阅读全文
posted @ 2023-06-12 16:58 代码诠释的世界 阅读(840) 评论(0) 推荐(0) 编辑
摘要:1、 介绍 本文使用u2net, pillow, 及backgroundremover进行照片背景的替换 2、安装 pip install pillow pip install backgroundremover 3、u2net介绍 https://github.com/xuebinqin/U-2- 阅读全文
posted @ 2023-05-31 17:37 代码诠释的世界 阅读(1022) 评论(0) 推荐(0) 编辑
摘要:一、场景 由于爬取某网站视频,遇到加密信息,需要使用脚本模拟实现信息自动转换,实现自动下载 二、以pkcs7为例 import base64 from Crypto.Cipher import AES from Crypto.Util.Padding import pad Url = 'https: 阅读全文
posted @ 2023-05-15 17:08 代码诠释的世界 阅读(994) 评论(0) 推荐(0) 编辑
摘要:1、起因 由于女友想看某网站付money视频,咱又不想充money,所以咱去网络上找在线解析的那种网站,下载下来,让其不用卡顿,不用手动复制黏贴,畅快的看视频 2、首先我们抓取电视剧的所有剧集链接 https://so.iqiyi.com/so/ 反正输入视频链接搜索就完了,然后拿到页面的url 然 阅读全文
posted @ 2023-05-11 17:50 代码诠释的世界 阅读(541) 评论(0) 推荐(0) 编辑
摘要:1、起因 因为测试需要向平板传输apk安装文件,插数据线比较麻烦,同一局域网起个服务方便又快捷,速度也快, linux下类似 2、官网文档 python3.11 https://docs.python.org/3/library/http.server.html python2.7(自行了解) ht 阅读全文
posted @ 2023-05-08 11:21 代码诠释的世界 阅读(389) 评论(0) 推荐(0) 编辑
摘要:1、问题 使用Python3 requests发送HTTPS请求,verify=False 已经关闭认证情况下,控制台会输出以下warning 2、处理 import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureReques 阅读全文
posted @ 2023-04-22 16:49 代码诠释的世界 阅读(19) 评论(0) 推荐(0) 编辑
摘要:1、问题 下载视频解析的时候报错No module named “Crypto”,已经pip安装 2、解决 pip uninstall crypto pycryptodome pip install pycryptodome pycrypto和crypto是同一个库,crypto在 python 中 阅读全文
posted @ 2023-04-22 16:46 代码诠释的世界 阅读(47) 评论(0) 推荐(0) 编辑
摘要:1、m3u8库 https://pypi.org/project/m3u8/ 2、安装 pip install m3u8 3、使用 import time from Crypto.Util.Padding import pad from Crypto.Cipher import AES import 阅读全文
posted @ 2023-04-22 16:39 代码诠释的世界 阅读(2361) 评论(0) 推荐(0) 编辑
摘要:处理方法: https://blog.csdn.net/kalath_aiur/article/details/103945309 阅读全文
posted @ 2023-03-23 11:07 代码诠释的世界 阅读(419) 评论(0) 推荐(0) 编辑
摘要:1、报错原因 路径中出现中文字符 2、处理方法 修改文件路径为英文 参考链接: https://blog.csdn.net/qq_54000767/article/details/129292229 阅读全文
posted @ 2023-03-23 10:20 代码诠释的世界 阅读(2683) 评论(0) 推荐(0) 编辑
摘要:1、场景 平时使用pycharm,有时出现导包问题,将那个目录Mark Directory as sources root,然后就可以正常运行代码了 2、原理 其实主要就是将那个目录加到PYTHONPATH中 先看未标记为sources root的PYTHONPATH环境变量输出 import os 阅读全文
posted @ 2023-03-21 21:02 代码诠释的世界 阅读(1516) 评论(0) 推荐(0) 编辑
摘要:1、场景 从接口读取数据写入文件时,在文件中显示的是Unicode字符 2、处理方法 import json def read_json_file(file_path): try: with open(file_path, mode='r', encoding='utf-8') as fp: res 阅读全文
posted @ 2022-10-26 10:06 代码诠释的世界 阅读(965) 评论(0) 推荐(0) 编辑
摘要:1、场景 自动化测试中,需要将一些接口自动的写入到yaml中, 但是发现文件中显示的是Unicode字符 2、处理方法 import yaml def load_yaml_data(file_path): try: with open(file_path, 'r', encoding='utf-8' 阅读全文
posted @ 2022-10-25 21:02 代码诠释的世界 阅读(317) 评论(0) 推荐(0) 编辑
摘要:1、问题 python调用grpc接口报错 2、原因 由于更新了代码,proto文件没有重新build生成 3、重新build方法 python -m grpc_tools.protoc --python_out=./tools/ --grpc_python_out=./tools/ -I. ./p 阅读全文
posted @ 2022-10-08 16:21 代码诠释的世界 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1、pypi https://pypi.org/project/pyqtgraph/ 2、安装 pip install pyqtgraph 阅读全文
posted @ 2022-10-08 16:15 代码诠释的世界 阅读(464) 评论(0) 推荐(0) 编辑
摘要:1、问题 做接口测试自动化时,参数传递时,默认给的null,直接写None会被解析成字符串 2、出问题的格式 打印 “Total': 'None' 3、正确的解析成None的方法 方式一,后面留空 输出 方式二、写成 null 输出 方式三、写成 ~ 输出 参考链接: https://blog.cs 阅读全文
posted @ 2022-10-01 16:00 代码诠释的世界 阅读(330) 评论(0) 推荐(0) 编辑
摘要:1、问题 rpc接口在调用的时候报错 2、原因 这个报错的意思就是int转换时,转换的对象不能调用 本次错误,主要是因为int(obj.a) 写成了int(obj.a()), 导致属性获取失败 3、处理 修改int(obj.a())为int(obj.a) 即可 本质上int转换的对象也就是那字符串, 阅读全文
posted @ 2022-10-01 15:43 代码诠释的世界 阅读(461) 评论(0) 推荐(0) 编辑
摘要:1、打开要提前加注释的函数 2、双击选中函数名,右键 3、点击【show Context Actions】 4、点击【insert a documentation string sub】 5、然后添加函数说明和参数说明即可 阅读全文
posted @ 2022-08-24 20:05 代码诠释的世界 阅读(231) 评论(0) 推荐(0) 编辑
摘要:1、pypi https://pypi.org/project/psutil/ 2、github https://github.com/giampaolo/psutil 3、doc https://psutil.readthedocs.io/en/latest/ 4、获取chromedriver.e 阅读全文
posted @ 2022-08-24 16:30 代码诠释的世界 阅读(1435) 评论(0) 推荐(0) 编辑

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