Geocoding and Reverse in python using Geopy
Duplicated code

You should try to follow the Don't Repeat Yourself principle.
In your case, most of the logic is repeated in 2 branches.

You could write :

if pattern.match(arg):
    loc=geolocator.reverse(arg)
else:
    loc=geolocator.geocode(arg)
if loc is not None:
    print(loc.address)
    print(loc.latitude, loc.longitude)
else:
    print "the location doesnt exist"


Alternatively, this could be written using conditional expressions :

loc = geolocator.reverse(arg) if pattern.match(arg) else geolocator.geocode(arg)