def parse_line(line, names, types):
    """
    parse line with expected names and types
    
    Example:
        parse_line(line, ['dt', 'ntstep', 'nbunch'], [float, int,int])
    
    """
    x = line.split()
    values =  [types[i](x[i]) for i in range(len(x))]
    return dict(zip(names, values))