To get local IPAddress in Python you can use the following snippet.

Sample Python

import socket
socket.gethostbyname(socket.gethostname())

One thought on “How to get local IPAddress in Python”

Leave a Reply