摘要: Python里的optparse是一个强大的命令行选项解析库 argument -- 参数 在命令行中输入的字符串,并会被 shell 传给 execl() 或 execv() 在 Python 中,参数将是 sys.argv[1:] 的元素 注: sys.argv[0] 是被执行的程序的名称 fr 阅读全文
posted @ 2024-04-14 23:44 慕尘 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 使用conda 创建环境时遇到 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=9.15)")' 镜像源修改成了清华镜像,但还是访问的默 阅读全文
posted @ 2024-04-11 23:06 慕尘 阅读(42) 评论(0) 推荐(0) 编辑
摘要: Anaconda切换到清华镜像源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna 阅读全文
posted @ 2024-04-11 22:12 慕尘 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 今天发现在新电脑上的mysql新插入的数据自增id不是连续的,步长为2 查看当前步长 show variables like '%increment%'; auto_increment_increment 2auto_increment_offset 1 1.使用命令修改 set @@global. 阅读全文
posted @ 2024-04-02 12:45 慕尘 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 今天发现刚移植过来的代码,数据库链接报错 connect ECONNREFUSED ::1:3306,把localhost解析成了 ::1,这是因为windows11中IPv6优先级设置高于IPv4 解决方法,修改数据库配置 const database = { HOST: '127.0.0.1', 阅读全文
posted @ 2024-04-02 11:58 慕尘 阅读(30) 评论(0) 推荐(0) 编辑
摘要: npm走国外的镜像,非常的慢,所以可以设置为淘宝镜像 查看当前仓库镜像 > npm config get registry https://registry.npmjs.org/ 设置淘宝仓库镜像 npm config set registry https://registry.npmmirror. 阅读全文
posted @ 2024-04-01 15:20 慕尘 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 由于刚换电脑,以至于很多都得重新安装,今天使用Python3时,遇到 No module named 'mysql' 解决方法安装mysql-connector pip install mysql-connector 阅读全文
posted @ 2024-04-01 15:09 慕尘 阅读(10) 评论(0) 推荐(0) 编辑
摘要: uni.navigateTo 用于页面跳转 如: <navigator url="/pages/index/index" hover-class="navigator-hover"> <button type="default">跳转</button> </navigator> 但是跳转页面失败,没 阅读全文
posted @ 2023-06-19 15:15 慕尘 阅读(837) 评论(0) 推荐(0) 编辑
摘要: 1.安装jsonwebtoken npm install jsonwebtoken 2.获取token,sign.js 先不加身份验证了,只是简单生成一个token const jwt = require('jsonwebtoken'); async function getToken(ctx) { 阅读全文
posted @ 2023-06-13 13:10 慕尘 阅读(92) 评论(0) 推荐(0) 编辑
摘要: package.json是用来识别项目并且处理项目的依赖关系的 { "name": "名",//包名字 "version": "1.0.0", //版本 "description": "描述", "main": "index.js",//入口文件 "scripts": {//指定运行脚本命令的 np 阅读全文
posted @ 2023-06-08 15:19 慕尘 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 需要使用python-docx (1)安装 python -m pip install python-docx (2)新建空白文档 from docx import Document document = Document() document.save('../data/123.docx') (3 阅读全文
posted @ 2022-10-20 13:28 慕尘 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 1.读取docx 需要使用python-docx (1)安装python-docx python -m pip install python-docx (2)读取docx import docx document = docx.Document("D:/资料/me/AA.docx") #获取所有段落 阅读全文
posted @ 2022-10-20 11:52 慕尘 阅读(6583) 评论(0) 推荐(0) 编辑
摘要: 先安装 pillow 介绍 pip install pillow 将多张图片合成PDF from PIL import Image import os # 防止字符串乱码 os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' def pic 阅读全文
posted @ 2022-09-20 14:16 慕尘 阅读(621) 评论(0) 推荐(0) 编辑
摘要: python中 os.listdir()方法用于返回指定的文件夹包含的文件或文件夹的名字的列表 import os path = "../data/materials/test/" path_list = os.listdir(path) print(path_list) 输出 ['1.jpg', 阅读全文
posted @ 2022-09-20 14:06 慕尘 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 在使用mysql-connector进行数据插入时,出现 'MySQLConverter' object has no attribute '_navigablestring_to_mysql' 具体位置 ins_sql = "INSERT INTO {} (name,radical,stroke_ 阅读全文
posted @ 2022-09-17 01:10 慕尘 阅读(71) 评论(0) 推荐(0) 编辑