📜  如何在python代码示例中获取本地ip

📅  最后修改于: 2022-03-11 14:46:54.092000             🧑  作者: Mango

代码示例3
import socket
local_ip = socket.gethostbyname(socket.gethostname())
print(f"[+] Your Local IP is : {local_ip}")