Compliance with convention.
变量和函数名遵循 pep8 https://www.python.org/dev/peps/pep-0008/#function-and-variable-names 不使用 `mixedCase`master
parent
fc30a00ada
commit
b2a175d76c
14
README.md
14
README.md
|
@ -305,12 +305,12 @@
|
||||||
以及其包含文件夹中文件的路径
|
以及其包含文件夹中文件的路径
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
for sChild in os.listdir(sPath):
|
for s_child in os.listdir(s_path):
|
||||||
sChildPath = os.path.join(sPath,sChild)
|
s_child_path = os.path.join(s_path, s_child)
|
||||||
if os.path.isdir(sChildPath):
|
if os.path.isdir(s_child_path):
|
||||||
print_directory_contents(sChildPath)
|
print_directory_contents(s_child_path)
|
||||||
else:
|
else:
|
||||||
print(sChildPath)
|
print(s_child_path)
|
||||||
```
|
```
|
||||||
# 模块与包
|
# 模块与包
|
||||||
## 2.1 输入日期, 判断这一天是这一年的第几天?
|
## 2.1 输入日期, 判断这一天是这一年的第几天?
|
||||||
|
@ -500,7 +500,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
|
||||||
```
|
```
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def getFiles(dir,suffix):
|
def get_files(dir,suffix):
|
||||||
res = []
|
res = []
|
||||||
for root,dirs,files in os.walk(dir):
|
for root,dirs,files in os.walk(dir):
|
||||||
for filename in files:
|
for filename in files:
|
||||||
|
@ -510,7 +510,7 @@ New 是真正创建实例对象的方法,所以重写基类的new 方法,以
|
||||||
|
|
||||||
print(res)
|
print(res)
|
||||||
|
|
||||||
getFiles("./",'.pyc')
|
get_files("./",'.pyc')
|
||||||
```
|
```
|
||||||
第二种方法:
|
第二种方法:
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue