]>
Commit | Line | Data |
---|---|---|
e51e1dec MT |
1 | #!/usr/bin/python3 |
2 | ||
3 | import location | |
4 | ||
5 | # Open the database | |
6 | d = location.Database("test.db") | |
7 | print(d) | |
8 | ||
9 | # Try to get information about AS123 | |
10 | a = d.get_as(123) | |
11 | print(a) | |
12 | ||
13 | # Try to get information about AS204867 | |
14 | a = d.get_as(204867) | |
15 | print(a) | |
16 | ||
17 | # Search for an IP address in the database | |
18 | n = d.lookup("8.8.8.8") | |
19 | print(n) | |
f66f15e1 MT |
20 | |
21 | n = d.lookup("2a07:1c44:5800:1234:1234:1234:1234:1234") | |
22 | print(n) |