null8626 / python-weather

A free and asynchronous weather API wrapper made in python, for python.
https://python-weather.rtfd.io
MIT License
100 stars 31 forks source link

when passing in to the function different locations nothing returns. #22

Closed kroboo closed 2 years ago

kroboo commented 2 years ago

i ve been trying to make a weather function for my discord application using python weather but every time i pass a different city other than : "Bucharest" or "Washington DC" . The following comes up. image i ve tried looking up the errors and nothing seems to work really. i dont know if this is an actual bug or me just being dump. for reference this is the script i wrote:

import python_weather
import asyncio
class WeatherFunc:
    def __init__(self,location):
        self.client = python_weather.Client(format=python_weather.METRIC)
        self.location = location

    async def on_call(self):
        weather = await self.client.find(self.location)
        print(weather.current.temperature)

        await self.client.close()
object1  = WeatherFunc("Sofia")
if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(object1.on_call())

if by any chance i am wrong sorry for addressing my issue and please tell me what i should change.

kroboo commented 2 years ago

@null8626

null8626 commented 2 years ago

I'll look into it in a while! Thanks for the report.

kroboo commented 2 years ago

@null8626 Thank you as well for responding ! notify me when you resolve the bug.All the best regards!

null8626 commented 2 years ago

<3

null8626 commented 2 years ago

This issue seems to be related to #25. Closing, sorry!