diff options
Diffstat (limited to 'ipqr.py')
| -rw-r--r-- | ipqr.py | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +import pyqrcode +import socket + + +def getIpAdress(): + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("8.8.8.8", 80)) + ipaddress = s.getsockname()[0] + return ipaddress + + +def getQrCode(): + ip = str(getIpAdress()) + url = pyqrcode.create(ip) + + url.png('ipqr.png', scale=6)
\ No newline at end of file |
