def write(file, desc, indexed):
    fileh = tables.open_file(file, "w")
    table = fileh.create_table(fileh.root, 'table', desc)
    for colname in indexed:
        table.colinstances[colname].create_index()

    row = table.row
    for i in range(10):
        row['x'] = i
        row['y'] = 10.2 - i
        row['z'] = i
        row['color'] = colors[random.choice(['red', 'green', 'blue'])]
        row['info/name'] = "name%s" % i
        row['info/info2/info3/z4'] = i
        # All the rest will be filled with defaults
        row.append()

    fileh.close()

# The sample nested class description
dataset/ETHPy150Open PyTables/PyTables/examples/nested1.py/write/original