def _qrcode_to_file ( qrcode , out_filepath ) : try : qrcode . save ( out_filepath ) except Exception as exc : raise IOError ( 'Error trying to save QR code file {}.' . format ( out_filepath ) ) from exc else : return qrcode
qrcode python how to save image to file
Save a qrcode object into out_filepath . Parameters ---------- qrcode : qrcode object
def _qrcode_to_file(qrcode, out_filepath):
    """ Save a `qrcode` object into `out_filepath`.
    Parameters
    ----------
    qrcode: qrcode object

    out_filepath: str
        Path to the output file.
    """
    try:
        qrcode.save(out_filepath)
    except Exception as exc:
        raise IOError('Error trying to save QR code file {}.'.format(out_filepath)) from exc
    else:
        return qrcode