Skip to content

Commit b2a175d

Browse files
authored
Compliance with convention.
变量和函数名遵循 pep8 https://www.python.org/dev/peps/pep-0008/#function-and-variable-names 不使用 `mixedCase`
1 parent fc30a00 commit b2a175d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@
305305
以及其包含文件夹中文件的路径
306306
"""
307307
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)
312312
else:
313-
print(sChildPath)
313+
print(s_child_path)
314314
```
315315
# 模块与包
316316
## 2.1 输入日期, 判断这一天是这一年的第几天?
@@ -500,7 +500,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
500500
```
501501
import os
502502
503-
def getFiles(dir,suffix):
503+
def get_files(dir,suffix):
504504
res = []
505505
for root,dirs,files in os.walk(dir):
506506
for filename in files:
@@ -510,7 +510,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
510510
511511
print(res)
512512
513-
getFiles("./",'.pyc')
513+
get_files("./",'.pyc')
514514
```
515515
第二种方法:
516516
```

0 commit comments

Comments
 (0)