1
我正在使用URL来获取给定城市的经度和纬度。当我通过 “纽约”作为字符串时,它不会给出任何结果,但是当我通过“新%20York”时,它就做到了。如何将纽约字样传递给查询字符串?查询字符串传递错误
current_location = 'New york' #not working
current_location2 = 'New%20York' # working
location_string = 'http://maps.googleapis.com/maps/api/geocode/json?address=' +current_location+ '&sensor=false'
是的我的坏,它真的工作 –