11 2019 档案

摘要:def generator(): for i in range(10): yield iret = generator()print(ret.__next__())print(ret.__next__())print(ret.__next__()) 加上yield就变成生成器函数了,返回值是yiel 阅读全文
posted @ 2019-11-25 13:50 不帅用砖拍 阅读(95) 评论(0) 推荐(0)
摘要:At first, you should install Django module: This may not work: pip3 install Django You should try the code below: sudo python3 -m pip install django - 阅读全文
posted @ 2019-11-18 14:15 不帅用砖拍 阅读(147) 评论(0) 推荐(0)
摘要:1、0.1版本 1 import os 2 3 4 def show_files(path, all_files): 5 # 首先遍历当前目录所有文件及文件夹 6 file_list = os.listdir(path) 7 # 准备循环判断每个元素是否是文件夹还是文件,是文件的话,把名称传入lis 阅读全文
posted @ 2019-11-04 17:14 不帅用砖拍 阅读(3553) 评论(0) 推荐(0)
摘要:废话不说,先上代码: 1 import os 2 3 4 def show_files(path, all_files): 5 # 首先遍历当前目录所有文件及文件夹 6 file_list = os.listdir(path) 7 # 准备循环判断每个元素是否是文件夹还是文件,是文件的话,把名称传入 阅读全文
posted @ 2019-11-04 16:07 不帅用砖拍 阅读(20255) 评论(0) 推荐(1)
摘要:首先,导入os模块 1 import os 获取当前文件所在文件夹的路径,getcwd() 更改当前目录:chdir() 创建文件夹,mkdir() 获取文件夹下所有子文件夹及文件,listdir() 判断是否是文件夹os.path.isdir() 更改文件名称,rename(old_name, n 阅读全文
posted @ 2019-11-04 11:49 不帅用砖拍 阅读(540) 评论(0) 推荐(0)