随笔分类 -  小脚本

摘要:random随机生成文件名: 1、随机生成几位(字母+数字):"".join(random.sample([x for x in string.ascii_letters + string.digits] , 位数)) 2、生成一个范围内的随机数:random.randint(1, 50) impo 阅读全文
posted @ 2022-01-24 11:43 野猫炫 阅读(881) 评论(0) 推荐(0) 编辑
摘要:下载pdf2docx pip install pdf2docx 在文件夹放上原pdf和空的word文档 from pdf2docx import Converter pdf_file = 'E:/1203/04741计算机网络原理复习资料(1).pdf' word_file = 'E:/1203/0 阅读全文
posted @ 2022-01-20 23:42 野猫炫 阅读(136) 评论(0) 推荐(0) 编辑
摘要:python批量输出指定文件夹文件数量 import os n_list=[11,12,13,14,15,50] n1_list=["tiktok","youtube","ins"] n2_list=["i","b","r"] for n in n_list: for n1 in n1_list: 阅读全文
posted @ 2022-01-20 16:55 野猫炫 阅读(249) 评论(0) 推荐(0) 编辑
摘要:1 import os 2 file_path=os.path.abspath(r"E:\20211015") 3 for i in range(41,51): 4 a="a{}".format(i) 5 file_name=file_path + "\\"+a 6 os.makedirs(file 阅读全文
posted @ 2021-12-08 15:47 野猫炫 阅读(54) 评论(0) 推荐(0) 编辑

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