Python常用工具类

简介: Python常用工具类

工具类

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')
相关文章
|
6天前
|
索引 Python
python-类属性操作
【10月更文挑战第11天】 python类属性操作列举
10 1
|
6天前
|
Java C++ Python
Python基础---类
【10月更文挑战第10天】Python类的定义
13 2
|
14天前
|
设计模式 开发者 Python
Python类里引用其他类
Python类里引用其他类
16 4
|
16天前
|
设计模式 开发者 Python
Python 类中引用其他类的实现详解
Python 类中引用其他类的实现详解
19 1
|
16天前
|
JSON 缓存 API
在 Python 中使用公共类处理接口请求的响应结果
在 Python 中使用公共类处理接口请求的响应结果
15 1
|
18天前
|
机器人 关系型数据库 Python
【Python篇】Python 类和对象:详细讲解(下篇)
【Python篇】Pyt hon 类和对象:详细讲解(下篇)
20 2
|
18天前
|
算法 Python
【Python篇】Python 类和对象:详细讲解(中篇)
【Python篇】Python 类和对象:详细讲解(中篇)
19 2
|
18天前
|
存储 C++ Python
【Python篇】Python 类和对象:详细讲解(上篇)
【Python篇】Python 类和对象:详细讲解(上篇)
16 2
|
28天前
|
前端开发 Python
Python编程的面向对象有哪些(二)
Python编程的面向对象(二)—类的多态
21 7
|
27天前
|
IDE Java 开发工具
Python类与面向对象
Python类与面向对象