chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本 2. 新增数据库操作、API调用工具 3. 新增Excel数据处理脚本 4. 新增弱密码检测脚本
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import pymysql
|
||||
import snowflake
|
||||
from faker import Faker
|
||||
fake = Faker('zh_CN')
|
||||
import random
|
||||
# 创建数据库连接
|
||||
conn = pymysql.connect(
|
||||
host='11.1.1.5',
|
||||
user='root',
|
||||
password='@HXYD1109mysql',
|
||||
database='school_server',
|
||||
charset='utf8'
|
||||
)
|
||||
# 创建游标对象
|
||||
cursor = conn.cursor()
|
||||
def create_table(cursor,result):
|
||||
|
||||
data = []
|
||||
for i in result:
|
||||
list_list = list(i)
|
||||
des=cursor.description # 获取表详情,字段名,长度,属性等
|
||||
t = ",".join([item[0] for item in des])
|
||||
table_head = t.split(',') # # 查询表列名 用,分割
|
||||
|
||||
dict_result = dict(zip(table_head, list_list)) # 打包为元组的列表 再转换为字典
|
||||
data.append(dict_result) # 将字典添加到list_result中
|
||||
return data
|
||||
Reference in New Issue
Block a user