當執行下面的 script 會出錯:
import socket (hostname, aliaslist, ipaddrlist) = socket.gethostbyname_ex(socket.gethostname())
Error message:
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
真的滿奇怪的,只好改從 netifaces 來拿 ip
python 取得 ip address 的方法
https://stackoverflow.max-everyday.com/2017/02/python-netifaces/