Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
WeatherBot/TestInput.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (24 sloc)
1020 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# identify keys words such as names of citys it the UK | |
import WeatherAPI | |
from geotext import GeoText | |
#import botTesting | |
# countryName =input("Enter Country Name: ") | |
# WeatherAPI.Weather.countrycall(countryName) | |
# cityName = input("Enter city Name: ") | |
# WeatherAPI.Weather.callWeatherAPI(cityName) | |
# get Weather information | |
# Based on countryName and then cityName | |
# find which country Name the user is looking for | |
# Then find the City name within that country | |
# out put the results New York | |
def getWeatherInfomation(userInput): | |
if GeoText(userInput).countries: # you must type the countries full name don't use UK use United Kingdom | |
# check if city is valid based on the country | |
if GeoText(userInput).cities: | |
WeatherAPI.Weather.callWeatherAPI(userInput) | |
else: | |
print("Your City does not Exist...") | |
else: | |
print("Your Country does not Exist...") | |
userInput = input("Enter Country Name: ") | |
getWeatherInfomation(userInput) |