Reputation: 673
My client has two offices in Germany and USA and a python program should recognize the office location. What will be the most elegant way to implement this? It only have to recognize the country. Furthermore it also could happens that there will be no permanent internet connection. The program works on windows but the solution should be os independent.
Any suggestions? Thanks
Upvotes: 3
Views: 372
Reputation: 92752
AFAIK, there's no elegant solution. You can make educated guesses, but then, take this example: I unplug my laptop in Germany and go to the USA. I plug it in the US office - the regional settings are the same, the time zone didn't change, now what?
Things from which you can make a guess:
By assigning a score to each of these things, and checking for each, you could get a probability score where the computer is. You might get some incorrect guesses though, so make a manual override, too.
The combined score might be quite accurate in the general case; what you need to do is find the edge and corner cases, then find some way to identify those.
Upvotes: 5