def to_qe_type(value):
    """
    Convert Python object to the (string) representation to be read in by QE.

    Args:
        obj: Python object to be converted

    Returns:
        conv_obj (str): String representation of converted Python object
    """
    if isinstance(value, str):
        return value
    elif isinstance(value, bool):
        return '.true.' if value else '.false.'
    elif isinstance(value, int) or isinstance(value, float):
        return str(value)
    else:
        raise Exception('Unknown type {0} [{1}].'.format(type(value), value))