def str2qr_image(text, image_path):
    """
    @brief      convert string to qrcode image & save
    @param      text         The string
    @param      image_path   Save image to the path
    """
    qr = qrcode.QRCode()
    qr.border = 1
    qr.add_data(text)
    qr.make(fit=True)
    img = qr.make_image()
    img.save(image_path)

    @brief      convert string to qrcode image & save
    @param      text         The string
    @param      image_path   Save image to the path
    
wxbot_project_py2.7/wechat/utils.py