def main(world_folder, start=None, stop=None):
    if (not os.path.exists(world_folder)):
        print("No such folder as "+world_folder)
        return 2 # ENOENT
    
    regions = glob.glob(os.path.join(world_folder,'region','*.mcr'))
    
    block_data_totals = [[0]*16 for i in range(256)] # up to 16 data numbers in 256 block IDs
    try:
        for filename in regions:
            region_totals = process_region_file(filename, start, stop)
            for i, data in enumerate(region_totals):
                for j, total in enumerate(data):
                    block_data_totals[i][j] += total
    
    except __HOLE__:
        print_results(block_data_totals)
        return 75 # EX_TEMPFAIL
    
    print_results(block_data_totals)
    return 0 # EX_OK
dataset/ETHPy150Open twoolie/NBT/examples/block_analysis.py/main