Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plotly showing routes

def get_location(name):
	name = name.lower()
	url = 'http://api.openweathermap.org/data/2.5/weather?q='+str(name)+'&appid='+str(<your_openweathermap_api>)
	open_url = urllib2.urlopen(url)
	open_w = json.load(open_url)
	ll = [i[1] for i in open_w['coord'].items()]
	lat = ll[0]
	lon = ll[1]
	return lat, lon

def map_locations(home, dest):
	initial_lat, initial_lon = get_location(home)
	final_lat, final_lon = get_location(dest)
	return initial_lat, initial_lon, final_lat, final_lon
Comment

PREVIOUS NEXT
Code Example
Python :: python glob wildcard filename 
Python :: Distribute Candy Algorithm Python 
Python :: python read text on screen 
Python :: how to sort a list of lists in reverse order using the first parameter in python 
Python :: Iterate over several iterables in parallel 
Python :: how to get unknown wifi password using python 
Python :: How determine if a number is even or odd using Recursive Inner Function 
Python :: accessing list elements in python 
Python :: Print feature importance per feature 
Python :: How to check if variable exists in a column 
Python :: nim game in python 
Python :: Comparing Sets with issubset() Function in python 
Python :: web parser python 
Python :: plot multiple ROC in python 
Python :: Joining String And Variable 
Python :: python Pandas - Analyzing DataFrames 
Python :: comparison operators in python 
Python :: Get First From Table Django 
Python :: list of bad words python 
Python :: Power Without BuiltIn Function 
Python :: python recognize lower and upper case user input 
Python :: eastcoders: django-meta-class 
Python :: how to run another python file in python 
Python :: how a 16 mp camera looks like 
Python :: draw a marker in basemap python 
Python :: python - create frequency table between two columns 
Python :: pandas map 
Python :: django.com 
Python :: argc python 
Python :: python insert text in string before certain symbol 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =