def get_qrcode_url(self, ticket, data=None):
url = '<STR_LIT>'.format(ticket=ticket)<EOL>if data:<EOL><INDENT>if isinstance(data, (dict, tuple, list)):<EOL><INDENT>data = urllib.urlencode(data)<EOL><DEDENT>data = to_text(base64.b64encode(to_binary(data)))<EOL>url = '<STR_LIT>'.format(base=url, data=data)<EOL><DEDENT>return url<EOL>
通过 ticket 换取二维码地址
详情请参考
https://iot.weixin.qq.com/wiki/new/index.html?page=3-4-4

:param ticket: 二维码 ticket
:param data: 额外数据
:return: 二维码地址