python 取得IP地址

 import socket
 socket.gethostbyname(socket.gethostname())
'192.168.18.10'

 

posted @ 2022-11-08 15:19  myrj  阅读(39)  评论(0编辑  收藏  举报