随笔分类 -  python_Code

摘要:# from asd.mode import * import sys import os import os.path import re rootdir = r"E:\4K Video Downloader\kkk"# 指明被遍历的文件夹 g_num = 31 def check(s): if 阅读全文
posted @ 2023-05-29 06:00 火焰马 阅读(11) 评论(0) 推荐(0)
摘要:if __name__ == '__main__': my_string = "Hello, world!" print(my_string[::-1]) # !dlrow ,olleH print(my_string[::-2]) # !lo olH print(my_string[:0:-1]) 阅读全文
posted @ 2023-03-25 23:29 火焰马 阅读(27) 评论(0) 推荐(0)
摘要:/* 时间:2021/12/29 功能:计算执行时间 logging 目录: 一: 计算执行时间 logging 二: logging */ 一: 计算执行时间 logging # 测试时间 import time mysql_url = "192.168.52.128" def decorator 阅读全文
posted @ 2021-12-19 22:17 火焰马 阅读(56) 评论(0) 推荐(0)
摘要:// encode -> # decode : bytes - string # encode : string - bytes from sys import argv script, encoding, error = argv def print_line(line, encoding, er 阅读全文
posted @ 2021-03-28 18:07 火焰马 阅读(61) 评论(0) 推荐(0)
摘要:from sys import argv script, filename = argv def read_file(): txt = open(filename, "r+", encoding="UTF-8") print(f"Here's your file {filename}: ") # p 阅读全文
posted @ 2021-03-28 18:04 火焰马 阅读(34) 评论(0) 推荐(0)
摘要:# 读取文件 class ExcelUtil(): def __init__(self, excel_path, sheet_name="int_lp"): self.data = xlrd.open_workbook(excel_path) self.table = self.data.sheet 阅读全文
posted @ 2021-01-25 00:11 火焰马 阅读(51) 评论(0) 推荐(0)
摘要:def random_name(self): # 常见姓氏 - 单姓氏 first_one_name = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华"\ "金魏陶姜戚谢邹喻水云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任袁"\ "柳鲍史唐费岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅卞齐康伍余"\ " 阅读全文
posted @ 2021-01-25 00:10 火焰马