05 2021 档案

摘要:import xpinyins="""廖娟赵兰英罗淑英袁玉华萧秀华徐磊宋桂荣莫瑜陆帅王淑兰魏建华苏军王飞李秀梅罗秀兰李波李艳李燕李雁薛建平黄成周旭季军杨秀荣关兰英伍欣郑宇王雷李娟雷霞李艳徐玉英仇雪梅李雷王洋李建孙晶何飞孙林郑玲王桂香田强陈华吴秀云董强阮秀云王洋谢秀云潘玉邹想吕秀云罗荣杨琴韩欣邬秀华章 阅读全文
posted @ 2021-05-23 10:23 candy耶 阅读(137) 评论(0) 推荐(0)
摘要:book = xlwt.Workbook()sheet = book.add_sheet("sheet1")title = ["id","name","sex","city"]students = [ [1,"a","男","北京"], [2,"b,"男","北京"], [3,"c","女","深圳 阅读全文
posted @ 2021-05-23 10:22 candy耶 阅读(56) 评论(0) 推荐(0)
摘要:import fakerf=faker.Faker(locale='zh_CN')print(dir(f)) #查看所有封装的地址 print(f.name()) #随机姓名print(f.address()) #随机街道print(f.city()) #随城市print(f.chrome()) # 阅读全文
posted @ 2021-05-23 10:19 candy耶 阅读(94) 评论(0) 推荐(0)
摘要:import osdef search_file(path,keyword): for cur_path,dirs,files in os.walk(path): for file_name in files: #xx.mp4 if keyword in file_name: abs_path = 阅读全文
posted @ 2021-05-16 23:17 candy耶 阅读(385) 评论(0) 推荐(0)
摘要:import random# print(random.randint(100000,999999))# print(random.uniform(1,99)) #随机小数a = '1223324'l = [2,23,52,35,235,23,523]# print(random.choice(l) 阅读全文
posted @ 2021-05-16 23:15 candy耶 阅读(246) 评论(0) 推荐(0)
摘要:#json#time、datetime#os、sys#randomimport os# os.rename('m1.py','M1.py')# os.remove()#删除文件,不能删除文件夹# os.rmdir('test')#删除空文件夹的# os.mkdir('cars/bmw') #创建文件 阅读全文
posted @ 2021-05-16 23:14 candy耶 阅读(107) 评论(0) 推荐(0)
摘要:import time#时间戳,从计算机诞生那一天到现在过了多少秒 1621063294#格式化好的时间 2021-5-15 19:38:23#2021515 ->50天后print( int(time.time()) ) #获取当前的时间戳print( time.strftime('%Y-%m-% 阅读全文
posted @ 2021-05-16 23:12 candy耶 阅读(161) 评论(0) 推荐(0)
摘要:# print()# input()# len()# type()# int()# str()# list()# tuple()# dict()# set()# float()# id() # avg = sum(l) / len(l) #计算平均值# print(avg)# print( max( 阅读全文
posted @ 2021-05-16 23:11 candy耶 阅读(90) 评论(0) 推荐(0)
摘要:解包: d = {"username":"admin","password":"123456"}print(d.items())# [('username', 'admin'), ('password', '123456')]for k,v in d.items(): print(k,v)递归 #函 阅读全文
posted @ 2021-05-02 08:04 candy耶 阅读(78) 评论(0) 推荐(0)
摘要:#函数==方法#提高的代码复用性,简化代码例子: def hello(): print('hello')def welcome(name,country="中国"): return name,countrydef test(): return r = hello()print('没有写return' 阅读全文
posted @ 2021-05-02 08:01 candy耶 阅读(51) 评论(0) 推荐(0)
摘要:import osf1 = open("user.txt",encoding='utf-8')f2 = open("user.txt.bak","w",encoding="utf-8")for line in f1: new_line = line.replace("周","周杰伦") f2.wri 阅读全文
posted @ 2021-05-02 07:59 candy耶 阅读(60) 评论(0) 推荐(0)