How to get local IPAddress in Python

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

Sample Python

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

Please Share us:
Please rate this snippet

One thought on “How to get local IPAddress in Python

Leave a Reply