会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
花式吹牛逼
博客园
首页
新随笔
联系
管理
订阅
2018年2月21日
删除同目录下面txt文件(利用os,fnmacth模块)
摘要: import osimport fnmatchfor filename in os.listdir('.'): if fnmatch.fnmatch(filename, '*.txt'): # 匹配模式为星号,表示任意的字符 os.remove(filename)
阅读全文
posted @ 2018-02-21 08:50 花式吹牛逼
阅读(163)
评论(2)
推荐(0)
2018年2月20日
利用递归函数随机生成N个TXT文件
摘要: import random#导入随机模块def fileduoduo(n): file_name = random.randint(000000, 999999)#文件名按六位数字随机生成 content = random.randint(000000000,999999999) n+=1 if n
阅读全文
posted @ 2018-02-20 18:02 花式吹牛逼
阅读(179)
评论(0)
推荐(0)