随笔分类 -  Python

摘要:#正则表达式相关符号说明:https://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html #正则对字符串相关操作:https://www.cnblogs.com/amengduo/p/9586732.html 1、python xpath 正 阅读全文
posted @ 2021-09-30 14:10 淡怀 阅读(73) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time :2021/9/26 14:29 @Author :维斯 @File :test.py @Version :1.0 @Function: """ from lxml import etre 阅读全文
posted @ 2021-09-26 14:34 淡怀 阅读(150) 评论(0) 推荐(0) 编辑
摘要:import time def wrapper_calc_time(print_log=True): """ 计算func执行时间 :param print_log: 是否打印日志 :return: """ def wrapper(func): def inner_wrapper(*args, ** 阅读全文
posted @ 2021-09-24 16:04 淡怀 阅读(154) 评论(0) 推荐(0) 编辑
摘要:参考 #!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : @Author : @File : @Version : @Function: """ import logging # 创建日志器 logger = logging.getLo 阅读全文
posted @ 2021-09-21 21:58 淡怀 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time :2021/9/18 16:27 @Author : @File :findFile.py @Version :1.0 @Function: """ import os class Fin 阅读全文
posted @ 2021-09-18 17:11 淡怀 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-09-01 13:41 淡怀 阅读(50) 评论(0) 推荐(0) 编辑
摘要:import datetime import os def update_file_name(file_path): """ 修改指定路径下的所有文件名称 os.listdir(path) 返回path路径下的文件及文件夹名称 os.rename(old_name, new_name) 将old_n 阅读全文
posted @ 2021-08-28 16:29 淡怀 阅读(301) 评论(0) 推荐(0) 编辑
摘要:def calcDateDiff(startDate: str, endDate: str, dateFormat='%Y/%m/%d'): """ 计算两个日期相差多少天 :param startDate: 开始日期 eg: '2020/03/25' :param endDate: 结束日期 eg 阅读全文
posted @ 2021-08-27 13:06 淡怀 阅读(1908) 评论(0) 推荐(1) 编辑
摘要:import datetime class DateTool: @staticmethod def offset(date_format, offset_type, count, data=None): """ 日期偏移(前N天、后N天) @param date_format: 格式(如:%Y-%m 阅读全文
posted @ 2021-08-26 14:37 淡怀 阅读(1278) 评论(0) 推荐(0) 编辑
摘要:参考 if __name__ == '__main__': s = [ {"no": 28, "score": 90}, {"no": 25, "score": 90}, {"no": 1, "score": 100}, {"no": 2, "score": 20}, ] # 单级排序,仅按照sco 阅读全文
posted @ 2021-07-12 06:14 淡怀 阅读(114) 评论(0) 推荐(0) 编辑
摘要:一、注册PyPI账号 https://pypi.org 二、创建项目 注意: 2.1、创建 “README.md” 文件 三、创建setup.py文件 可直接复制 修改对应信息即可 setup.py文件 #!/usr/bin/env python # -*- coding: utf-8 -*- "" 阅读全文
posted @ 2021-06-21 18:14 淡怀 阅读(1246) 评论(1) 推荐(1) 编辑
摘要:一般异常捕获做法(不够灵活,复用性不强) if __name__ == '__main__': # 一般做法(或者再加个循环触发) try: driver.switch_to.alert.accept() # 有可能弹框没出来 会报错 except: time.sleep(5) driver_.sw 阅读全文
posted @ 2021-06-09 11:50 淡怀 阅读(397) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/HoyAnGx/article/details/124835576 阅读全文
posted @ 2021-03-01 20:48 淡怀 阅读(83) 评论(0) 推荐(0) 编辑
摘要:TensorFlow官方文档 TODO: 1、保存并复用训练好的模型 2、loss值为nan 3、matlab 根据一个曲线 求出此曲线的函数表达式 pip3 install tensorflow -i http://pypi.douban.com/simple/ --trusted-host py 阅读全文
posted @ 2021-01-29 01:20 淡怀 阅读(594) 评论(0) 推荐(0) 编辑
摘要:一、列表去重 if __name__ == '__main__': old_arr = [1, 2, 1, 2, 2, 2, 2, 4, 2, 3, 2, 5, 2, 7, 2] new_arr = list(set(old_arr)) # 用set去重(去重后顺序是乱的) new_arr.sort 阅读全文
posted @ 2021-01-13 19:06 淡怀 阅读(1208) 评论(0) 推荐(0) 编辑
摘要:一、所有的姓氏 百家姓所有姓氏 ['赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '褚', '卫', '蒋', '沈', '韩', '杨', '朱', '秦', '尤', '许', '何', '吕' 阅读全文
posted @ 2020-12-15 15:12 淡怀 阅读(6860) 评论(1) 推荐(1) 编辑
摘要:参考文章:VUE入门+5个小案例 前端布局:https://www.cnblogs.com/danhuai/p/14483489.html 一、概述 二、前端页面开发 2.1、在html文件的头中引入相关模块 <head> <meta charset="UTF-8"> <meta name="vie 阅读全文
posted @ 2020-12-07 22:20 淡怀 阅读(5977) 评论(0) 推荐(1) 编辑
摘要:https://zhuanlan.zhihu.com/p/36590576 https://blog.csdn.net/qq_19582693/article/details/100598710 https://blog.csdn.net/hpwzjz/article/details/8970331 阅读全文
posted @ 2020-11-23 16:47 淡怀 阅读(1132) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/l835311324/article/details/86608850 https://blog.csdn.net/zhangphil/article/details/88577091 https://www.cnblogs.com/cnhyk/p/136 阅读全文
posted @ 2020-11-21 18:06 淡怀 阅读(82) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_39241986/article/details/108231810 阅读全文
posted @ 2020-11-18 13:23 淡怀 阅读(505) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示