Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,8 +32,8 @@ def get_weather(location: str, celsius: Optional[bool] = False) -> str:
|
|
| 32 |
Returns:
|
| 33 |
A string describing the current weather at the location.
|
| 34 |
"""
|
| 35 |
-
|
| 36 |
-
os.environ['WEATHERSTACK_API_KEY'] = 'weather_api_key'
|
| 37 |
units = "m" if celsius else "f" # 'm' for Celsius, 'f' for Fahrenheit
|
| 38 |
|
| 39 |
url = f"http://api.weatherstack.com/current?access_key={api_key}&query={location}&units={units}"
|
|
|
|
| 32 |
Returns:
|
| 33 |
A string describing the current weather at the location.
|
| 34 |
"""
|
| 35 |
+
api_key = os.environ['weather_api_key'] # Replace with your API key from https://weatherstack.com/
|
| 36 |
+
# os.environ['WEATHERSTACK_API_KEY'] = 'weather_api_key'
|
| 37 |
units = "m" if celsius else "f" # 'm' for Celsius, 'f' for Fahrenheit
|
| 38 |
|
| 39 |
url = f"http://api.weatherstack.com/current?access_key={api_key}&query={location}&units={units}"
|