-
Notifications
You must be signed in to change notification settings - Fork 0
/
python.py
38 lines (28 loc) · 920 Bytes
/
python.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
from os import listdir
from os.path import isfile, join
mypath = "c:\\tool"
logpath = "c:\\Tool\\JEE\\HW\\HW-ASPICE"
# onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
# print(onlyfiles)
# print('\n')
# arr = os.listdir()
# print(arr)
print("Start scan.........................plz wait.........")
mylog = open("mylog.txt", "a", encoding="utf-8")
thisdir = mypath #os.getcwd()
# r=root, d=directories, f = files
# for r, d, f in os.walk(thisdir):
# for file in f:
# if file.endswith(".docx"):
# print(os.path.join(r, file))
for path, subdirs, files in os.walk(thisdir):
for name in files:
mylog.write(os.path.join(path, name))
mylog.write('\n')
print("..")
#print(subdirs)
#if name.endswith(".docx"):
# print(os.path.join(path, name))
mylog.close()
print("Done...........Bye Bye--------------------------------")