Hello I am new to python and am trying to work with a Dark Sky python API made by Detrous. When I run the demo code I am presented with an error:
forecast = await darksky.get_forecast(
^
SyntaxError: 'await' outside function
this error results from:
forecast = await darksky.get_forecast(
latitude, longitude,
extend=False, # default `False`
lang=languages.ENGLISH, # default `ENGLISH`
units=units.AUTO, # default `auto`
exclude=[weather.MINUTELY, weather.ALERTS] # default `[]`
)
I am not too sure how to resolve this issue and am using python 3.
Thanks
await
beforedarksky.get_forecast(
– Portentasync def main()
then call it – Kindergarten