Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
#This whole section of code is the weather feature
#code copied from: https://www.youtube.com/watch?v=gOWm5rF_qdc&list=PLtN7kQKfzoJOJYt_yhn_xHWsORCMsEOXq&index=4&t=194s
#pwown is a module
#Needs to be installed first for the code to be able to run
import pyowm
#api code within the bracket was obtained from: https://openweathermap.org/
own = pyowm.OWM('7050f6a47e2d8369b80ae88aafb6c357')
#The user inputs the name of the location
#The variable 'inputLoc' was created on my own
inputLoc = input("tell me your location: ")
location = own.weather_at_place(inputLoc)
weather = location.get_weather()
temp = weather.get_temperature('celsius')
humidity = weather.get_humidity()
#receive the temperature (in celcius) and humidity of chosen location
print(temp)
print(humidity)