Skip to content
Advertisement

Tag: ip-address

Getting City from IP Address range

I have an IP address. For example, 192.168.2.10 Also I have a dictionary: Question: How should I find the city from my IP address and use this dictionary spending less time (time complexity) as possible? Answer The “proper answer” if you want the best complexity for arbitrarily large data sets is the one given given by Ji Bin. To really

How do I determine all of my IP addresses when I have multiple NICs?

I have multiple Network Interface Cards on my computer, each with its own IP address. When I use gethostbyname(gethostname()) from Python’s (built-in) socket module, it will only return one of them. How do I get the others? Answer Use the netifaces module. Because networking is complex, using netifaces can be a little tricky, but here’s how to do what you

Finding a public facing IP address in Python?

How can I find the public facing IP for my net work in Python? Answer This will fetch your remote IP address If you don’t want to rely on someone else, then just upload something like this PHP script: and change the URL in the Python or if you prefer ASP: Note: I don’t know ASP, but I figured it

Advertisement