获取文件夹下所有文件名.py
import os
import time
filePath = 'C:/--------老男孩全栈--------/'
for i,j,k in os.walk(filePath):
#print(i)
#print(j)
#print(k)
for bb in k:
time.sleep(0.01)
#with open("test.txt", "w") as f:
#f.writelines(bb)
#print(bb)
f = open('test.txt','a+')
f.writelines(bb)
f.writelines('\n')
f.close()
print(bb)