import os
def findfile(file,path):
for f in os.listdir(path):
if os.path.isdir(os.path.join(path,f)):
findfile(file,os.path.join(path,f))
if f.find(file)>=0:
print(os.path.join(path,f))
else:
findfile('py','.')
Sign in to make a reply
0_0深夜
import os
def findfile(file,path):
for f in os.listdir(path):
if os.path.isdir(os.path.join(path,f)):
findfile(file,os.path.join(path,f))
if f.find(file)>=0:
print(os.path.join(path,f))
else:
if f.find(file)>=0:
print(os.path.join(path,f))
findfile('py','.')