会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
darling
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
2022年5月7日
pyMysql 链接断开或者不断开的报错剖析
摘要: pyMysql 链接使用后,不关闭报错 pymysql.err.InterfaceError: (0, ‘‘) 导致这个错误的原因是通过pymysql连接MySQL,没有关闭连接的操作,所以短时间内不会出问题,长时间保持这个连接会出现连接混乱。虽然看着自己的代码没错,还是会报pymysql.err.
阅读全文
posted @ 2022-05-07 00:04 darling331
阅读(545)
评论(0)
推荐(0)
2022年5月6日
python 执行mysql连接池 封装增删改查方法
摘要: 拿来即用的mysql连接池使用源码 # -*- ecoding: utf-8 -*- # @ModuleName: test002 # @Function: # @Author: darling # @Time: 2022-05-05 20:01 import configparser import
阅读全文
posted @ 2022-05-06 23:56 darling331
阅读(202)
评论(0)
推荐(0)
python 使用数据库配置文件时,打包成exe后,找不到配置文件 报错 【Python configparser No section: 'dbMysql'】
摘要: 原代码 def __init__(self, config_filename="dbMysqlConfig.cnf"): file_path = os.path.join(os.path.dirname(__file__), config_filename) self.cf = configpars
阅读全文
posted @ 2022-05-06 23:51 darling331
阅读(310)
评论(0)
推荐(0)
python 使用jieba+pyinstaller 打包时出现的问题
摘要: 操作系统:windows10 语言:Python3.9 IDE: PyCharm 本地代码执行时,使用jieba分词库,没有问题。原代码如下: # encoding = utf - 8 import jieba def word_segmentation(sentence): words_gener
阅读全文
posted @ 2022-05-06 23:40 darling331
阅读(453)
评论(0)
推荐(0)
python pymysql读取配置文件链接数据库
摘要: dbMysqlConfig.cnf [dbMysql] host = 127.0.0.1 port = 3306 user = root password = wonderful2021 db_name = test001 charset = utf8 直接读取配置文件进行链接 # -*- ecod
阅读全文
posted @ 2022-05-06 15:00 darling331
阅读(319)
评论(0)
推荐(0)
2022年4月27日
python 画一颗简单的圣诞树
摘要: # -*- ecoding: utf-8 -*- # @ModuleName: test008 # @Function: 一颗圣诞树 # @Author: darling # @Time: 2021-12-22 11:12 from turtle import * import random imp
阅读全文
posted @ 2022-04-27 11:25 darling331
阅读(189)
评论(0)
推荐(0)
python 利用 Faker 生成测试数据
摘要: # -*- coding:utf-8 -*- import time from concurrent.futures import ThreadPoolExecutor import pymysql from faker import Faker import sys from dbUntils.m
阅读全文
posted @ 2022-04-27 11:22 darling331
阅读(110)
评论(0)
推荐(0)
2022年4月18日
python 对json返回值进行序列化
摘要: # -*- ecoding: utf-8 -*- # @ModuleName: test004 # @Function: # @Author: darling # @Time: 2022-04-15 17:46 import requests # linux执行登陆请调用下面的这句 def get_
阅读全文
posted @ 2022-04-18 19:34 darling331
阅读(76)
评论(0)
推荐(0)
python 使用xpath获取网页标签内容
摘要: 获取指定html的标签内容 打开网页的开发者模式,得到路径标签,然后加上/text() 即可得到标签的文本内容 //*[@id="sonsyuanwen"]/div[1]/h1 对于网页爬取来说,还是很方便的 # -*- ecoding: utf-8 -*- # @ModuleName: test0
阅读全文
posted @ 2022-04-18 19:30 darling331
阅读(1102)
评论(0)
推荐(0)
2022年4月12日
python 按照excel表头字符串读取单元格数据
摘要: 原理 先获取表格第一行表头字符串所在的列下标,循环行数时,可以得到行,进而定位到指定的单元格。 # -*- ecoding: utf-8 -*- # @ModuleName: test001 # @Function: # @Author: darling # @Time: 2022-04-12 15
阅读全文
posted @ 2022-04-12 14:05 darling331
阅读(682)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
公告