Heads Up :
The post you are writing will appear in a public forum. Please ensure all content is appropriate for public consumption. Review the employee guidelines for the community here.
If you want to get the IP address of whichever interface is used to connect to the network without having to know its name, you can use this: import socketdef get_ip_address():s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)s.connect(("8.8.8.8", ...