
5 Python Scripts That Replaced My Browser Tabs (With Code)
I used to have 15+ browser tabs open every morning: weather, stock prices, news, ISS position (yes really), exchange rates. Then I wrote 5 Python scripts that fetch all that data in under 2 seconds. Now I run one command and get everything in my terminal. Here they are. 1. Weather Dashboard (Open-Meteo API) import requests def weather ( lat , lon ): r = requests . get ( f ' https://api.open-meteo.com/v1/forecast?latitude= { lat } &longitude= { lon } ¤t_weather=true ' ) w = r . json ()[ ' current_weather ' ] print ( f ' Weather: { w [ " temperature " ] } C, wind { w [ " windspeed " ] } km/h ' ) weather ( 55.75 , 37.62 ) # Moscow Replaced: weather.com tab 2. Crypto Portfolio Check (CoinGecko) import requests def crypto (): coins = ' bitcoin,ethereum,solana ' r = requests . get ( f ' https://api.coingecko.com/api/v3/simple/price?ids= { coins } &vs_currencies=usd&include_24hr_change=true ' ) for name , data in r . json (). items (): print ( f ' { name } : $ { data [ " usd " ] : ,. 0
Continue reading on Dev.to Beginners
Opens in a new tab




