import os
def findfile(path): for x in os.listdir(path): if os.path.isfile(x) and os.path.splitext(x)[1] == '.docx': print(x) elif os.path.isdir(x): d = os.path.join(path, x) findfile(d)
test = os.path.abspath('.') findfile(test)
Sign in to make a reply
GOGOGO-枼子
import os
def findfile(path): for x in os.listdir(path): if os.path.isfile(x) and os.path.splitext(x)[1] == '.docx': print(x) elif os.path.isdir(x): d = os.path.join(path, x) findfile(d)
test = os.path.abspath('.') findfile(test)