工具类
wifi二维码
wifiqrcode.py
# pip install qrcode import qrcode def wifi_qr_generator(wifi_name, password, encrption='WPA'): wifi_template = f'WIFI:S:{wifi_name};T:{encrption};P:{password};;' qr = qrcode.QRCode( version=1, box_size=10, border=4, ) qr.add_data(wifi_template) qr.make(fit=True) qr_img = qr.make_image(fill='black', back_color='white') qr_img.save('wifi_qr.png') if __name__ == '__main__': wifi_qr_generator('ChinaNet', 'pwd')