![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
PanYu——BJ
懂些皮毛
展开
-
python - 将实体类属性转换为SQL字段
1.对JAVA代码中的private属性进行过滤 2.将这些属性修改为对应的sql # 去掉前缀空格,";"和"private"替换为空 # 将属性中JAVA类型修改为对应的SQL类型 # 将字段名称中大写字母转换为"_+小写字母" def property_transfer(line): res =""; line = line.replace(";","").replace("private","").strip() attribute_type = line.split(" "原创 2021-07-08 17:12:07 · 329 阅读 · 0 评论 -
python - 个性化SQL格式化_001
主要实现对sql中属性为 驼峰命名 转换为 下划线分割命名 # 正则模块 import re # 对不需要处理的行返回False def line_info_filter(line): if len(line)<3: return True for info in row_info: if info in line: return True return False # 将字段名称中大写字母转换为"_+小写字母" d原创 2021-07-08 17:00:48 · 681 阅读 · 0 评论 -
python - 日志
python日志打印方法 import logging def log(): #创建logger,如果参数为空则返回root logger logger = logging.getLogger("panyu") # logger.setLevel(logging.DEBUG) #设置logger日志等级 logger.setLevel(logging.INFO) #设置logger日志等级 print("handlers",logger.handlers)原创 2021-07-08 16:57:55 · 106 阅读 · 0 评论 -
python - JSON 合并
将多个JSON合并为一个完整的JSON import json import os import uuid # 需要合并多少个文件 file_num =1 # 读取文件中内容 并转换为JSON返回 def fileInfoToJson(file_path): f = open(file_path,"r",encoding="utf-8") f_dt = json.load(f,parse_int=float) return f_dt; # 遍历指定目录,显示目录下的所原创 2021-07-08 16:56:03 · 788 阅读 · 0 评论