上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页
摘要: pyMysql 链接使用后,不关闭报错 pymysql.err.InterfaceError: (0, ‘‘) 导致这个错误的原因是通过pymysql连接MySQL,没有关闭连接的操作,所以短时间内不会出问题,长时间保持这个连接会出现连接混乱。虽然看着自己的代码没错,还是会报pymysql.err. 阅读全文
posted @ 2022-05-07 00:04 darling331 阅读(411) 评论(0) 推荐(0) 编辑
摘要: 拿来即用的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 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 原代码 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 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 操作系统:windows10 语言:Python3.9 IDE: PyCharm 本地代码执行时,使用jieba分词库,没有问题。原代码如下: # encoding = utf - 8 import jieba def word_segmentation(sentence): words_gener 阅读全文
posted @ 2022-05-06 23:40 darling331 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(181) 评论(0) 推荐(0) 编辑
摘要: # -*- 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 阅读(125) 评论(0) 推荐(0) 编辑
摘要: # -*- 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 阅读(59) 评论(0) 推荐(0) 编辑
摘要: # -*- 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 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 获取指定html的标签内容 打开网页的开发者模式,得到路径标签,然后加上/text() 即可得到标签的文本内容 //*[@id="sonsyuanwen"]/div[1]/h1 对于网页爬取来说,还是很方便的 # -*- ecoding: utf-8 -*- # @ModuleName: test0 阅读全文
posted @ 2022-04-18 19:30 darling331 阅读(976) 评论(0) 推荐(0) 编辑
摘要: 原理 先获取表格第一行表头字符串所在的列下标,循环行数时,可以得到行,进而定位到指定的单元格。 # -*- ecoding: utf-8 -*- # @ModuleName: test001 # @Function: # @Author: darling # @Time: 2022-04-12 15 阅读全文
posted @ 2022-04-12 14:05 darling331 阅读(452) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页