0

I have this code in a file called grab.py

import urllib, json
url = "http://maps.googleapis.com/maps/api/geocode/json?address=googleplex&sensor=false"
response = urllib.urlopen(url)
data = json.loads(response.read())
print data

But when I run it I get this error:

File "grab.py", line 1, in <module>                                   

    import urllib, json
File "/home/cabox/workspace/json.py", line 3, in <module>             
AttributeError: 'module' object has no attribute 'loads'
Wayne Werner
  • 49,299
  • 29
  • 200
  • 290

0 Answers0