Record your races with a typeracer account:
Create Your Account- Save your race history and scores.
- Customize your profile and racecar.
- It’s free, why not?
Race Result Details |
Racer | Krišjānis (krisjanisp) |
Race Number | 2 |
Date | Thu, 4 Aug 2022 18:30:48 +0000 |
Universe | code |
Speed | 60 WPM Try to beat? |
Accuracy | 96.2% |
Rank | 1st place (out of 3) |
Text typed:
import re
import sys
import urllib2
import BeautifulSoup
usage = "Run the script: ./geolocate.py IPAddress"
if len(sys.argv)!=2:
print(usage)
sys.exit(0)
if len(sys.argv) > 1:
ipaddr = sys.argv[1]
geody = "http://www.geody.com/geoip.php?ip=" + ipaddr
html_page = urllib2.urlopen(geody).read()
soup = BeautifulSoup.BeautifulSoup(html_page)
— Get GEO Location from IP Address
(other)
by www.pythonforbeginners.com/
(see stats)
|