ogclone-engine/client/interfaceAdm/GetIpAddress.py

12 lines
223 B
Python

import socket
#!/usr/bin/env python3
def get_ip_address():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
return ip_address
if __name__ == "__main__":
print(get_ip_address())