pencil.io.walklevel

Functions

walklevel(some_dir[, level])

Walklevel walks through higher level dirs to a certain depth.

Module Contents

pencil.io.walklevel.walklevel(some_dir, level=1)

Walklevel walks through higher level dirs to a certain depth. Is used as an interator in loops, e.g.:

sim_paths = [] for path,dirs,files in walklevel(‘.’, depth):

if ‘start.in’ in files and ‘run.in’ in files:

print ‘## Found Simulation in ‘+path sim_paths.append(path)

Parameters:
  • some_dir – at which dir to start the walklevel algorithm

  • level – how deep this algorithm shall walk through dirs, default is 1

Yields:

yield root, dirs, files