#NEWLINE# def listfiles( d ) : #NEWLINE# #INDENT# basedir = d #NEWLINE# subdirlist = [ ] #NEWLINE# for item in os . listdir ( d ) : #NEWLINE# #INDENT# fn = join ( subdirlist , item ) #NEWLINE# if isfile ( fn ) : #NEWLINE# #INDENT# ( yield fn ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# subdirlist . append ( os . path . join ( basedir , item ) ) #NEWLINE# #UNINDENT# #UNINDENT# for subdir in subdirlist : #NEWLINE# #INDENT# for fn in listfiles ( subdir ) : #NEWLINE# #INDENT# ( yield fn )