def _make_setter(command, fmt="{}"):
    """Return a setter for use with property().

    command is a SCPI string, such as 'SOUR:AMPL'
    fmt is as per str.format().
        use '{:d}' for boolean int
        use '{},{},{}' or similar if setting a tuple
    parent can be used to climb up a self.parent.parent... tree.
    """

    def scpi_setter(self, value):
        if not type(value) == list:
            value = [value]
        fixed_fmt = fmt.replace('{:bool}', '{:d}')
        set_string = fixed_fmt.format(*value)
        command_string = command.format(subaddr=self._sub_address)
        self.raw_write(command_string + ' ' + set_string)
    return scpi_setter