I've been using the weather site Open Weather Map (https://openweathermap.org/) to get details for a project in Python.
rain = w.get_rain() # Get rain volume {'3h': 0}
wind = w.get_wind() # Get wind degree and speed {'deg': 59, 'speed': 2.660}
humidity = w.get_humidity() # Get humidity percentage 67
And then insert them the variables into a database, which doesn't like '{' '}'.
I've tried removing the '{' '}' from the outputs, looking at replies from this site. Strip:
rain = rain.strip(['{','}'])
and Replace:
rain = rain.replace('{', ' ')
But all I'm getting are "AttributeError: 'dict' object has no attribute". Is there another escape clause I could use for the variable to remove the unwanted characters?