python - urls.py regex help with coordinates -


i tried searching not find answer this.

i trying write function takes in coordinates, ie latitude , longitude. example, 53.345633,-6.267014.

these fed google maps api users current location, , directions nearby places (i have these locations stored somewhere) , directions returned.

so, pretty have maps work done, can't test because, frustratingly enough, cannot figure out regex inside urls.py.

can me this? i'm hoping simple enough guys. tried earlier failed miserably! it's frustrating coz i'm close finishing part too!!

thanks help!

ps format coordinates advisable, comma? perhaps 53.345633+-6.267014 better (then can use my_coords = coords.replace("+", ", ") or something)??

i'm not sure can try :

def str2cords(scords):     return [float(c) c in scords.split(',')] #or maybe scords.split(',') since float might mess exact cords? 

or regex :

'/(-?\d+\.\d+),(-?\d+\.\d+)/' 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -