File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 305
305
以及其包含文件夹中文件的路径
306
306
"""
307
307
import os
308
- for sChild in os.listdir(sPath ):
309
- sChildPath = os.path.join(sPath,sChild )
310
- if os.path.isdir(sChildPath ):
311
- print_directory_contents(sChildPath )
308
+ for s_child in os.listdir(s_path ):
309
+ s_child_path = os.path.join(s_path, s_child )
310
+ if os.path.isdir(s_child_path ):
311
+ print_directory_contents(s_child_path )
312
312
else:
313
- print(sChildPath )
313
+ print(s_child_path )
314
314
```
315
315
# 模块与包
316
316
## 2.1 输入日期, 判断这一天是这一年的第几天?
@@ -500,7 +500,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
500
500
```
501
501
import os
502
502
503
- def getFiles (dir,suffix):
503
+ def get_files (dir,suffix):
504
504
res = []
505
505
for root,dirs,files in os.walk(dir):
506
506
for filename in files:
@@ -510,7 +510,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
510
510
511
511
print(res)
512
512
513
- getFiles ("./",'.pyc')
513
+ get_files ("./",'.pyc')
514
514
```
515
515
第二种方法:
516
516
```
You can’t perform that action at this time.
0 commit comments