-
Notifications
You must be signed in to change notification settings - Fork 5
/
qr.py
executable file
·31 lines (24 loc) · 1.17 KB
/
qr.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/local/bin/python3
import qr_img
import subprocess
import qrcode
### you probably need to change these fields!
## default Ubuntu Store Blender location
# blender_path = '/snap/bin/blender'
## default MacOS Blender location
blender_path = '/Applications/Blender.app/Contents/MacOS/Blender'
## default Windows Blender location
# blender_path = 'C:/Program Files/Blender Foundation/Blender/blender.exe'
auth_type = 'WPA' # WPA or WEP or ''
ssid = "SSID GOES HERE" # name of your wifi network
password = 'PASSWORD GOES HERE' # wifi password
# if you don't want to make a wifi qr code, change this to whatever you do want
# data = 'https://example.com'
data = 'WIFI:T:%s;S:%s;P:%s;;'%(auth_type, ssid, password)
# generate png, using icon_path for icon and placing result at output_path, not necessary for STL
qr_img.generate_png(data=data, icon_path='files/wifi.png', output_path='files/qr.png')
# generate svg and placing at output_path, necessary if you don't already have an SVG
qr_img.generate_svg(data=data, output_path='files/qr.svg')
# generate STL
subprocess.run([blender_path, '--background', '--python', 'qr_blend.py'])
#subprocess.run([blender_path, '--python', 'qr_blend.py'])