summaryrefslogtreecommitdiff
path: root/ipqr.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipqr.py')
-rw-r--r--ipqr.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/ipqr.py b/ipqr.py
new file mode 100644
index 0000000..33a4f94
--- /dev/null
+++ b/ipqr.py
@@ -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