|
@@ -0,0 +1,30 @@
|
|
|
|
|
+from operator import delitem
|
|
|
|
|
+import qrcode
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def func():
|
|
|
|
|
+ target_root = "E:\\qrcode"
|
|
|
|
|
+ device_list = [
|
|
|
|
|
+ 861551056096605,
|
|
|
|
|
+ 861551056092265,
|
|
|
|
|
+ 861551055313621,
|
|
|
|
|
+ 861551056102270
|
|
|
|
|
+ ]
|
|
|
|
|
+ root_url = "http://www.hnyfwlw.com:8002/qxz?device_id="
|
|
|
|
|
+ for device in device_list:
|
|
|
|
|
+ qr = qrcode.QRCode(version=1,
|
|
|
|
|
+ error_correction=qrcode.constants.ERROR_CORRECT_M,
|
|
|
|
|
+ box_size=10,
|
|
|
|
|
+ border=4)
|
|
|
|
|
+ qr.make(f"{root_url}{device}")
|
|
|
|
|
+
|
|
|
|
|
+ img=qr.make_image(fill_color='blue',back_color="black")
|
|
|
|
|
+
|
|
|
|
|
+ img.save(f"{target_root}\\{device}.jpg")
|
|
|
|
|
+ print(f"保存本地完成")
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+if __name__ == "__main__":
|
|
|
|
|
+ func()
|
|
|
|
|
+
|