目录
import os
def search_by_date(path):
if os.path.isdir(path):
dirs = os.listdir(path)
for i in dirs:
print(os.path.join(path, i))
if os.path.isdir(os.path.join(path, i)):
return search_by_date(os.path.isdir(os.path.join(path, i)))
else:
print(path)
path = 'c:/'
search_by_date(path)
import os
def search_by_date(path):
if os.path.isdir(path):
dirs = os.listdir(path)
for i in dirs:
print(os.path.join(path, i))
if os.path.isdir(os.path.join(path, i)):
return search_by_date(os.path.join(path, i))
else:
print(path)
path = 'c:/'
search_by_date(path)