Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Sockets
-
I was writing something that needs the iPad's ipaddress.
ip = socket.gethostbyname(socket.gethostname())
results in
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
Is there a way to find the ipaddress?
-
OMZ's code was:
import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8',80)) print s.getsockname()[0] s.close()
As documented in the thread http://omz-forums.appspot.com/pythonista/post/5778981575983104