Discuss / Python / 第二题

第二题

Topic source

0_0深夜

#1 Created at ... [Delete] [Delete and Lock User]

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','.')


  • 1

Reply