Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: rbowman Newsgroups: comp.os.linux.misc Subject: Re: Python/C/Pascal ... How To Choose ? Date: 9 Nov 2025 19:28:33 GMT Lines: 92 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net cHfiAa23+zDm0gl2L3YL8gm7yUhvu2IKbid32Xcb/YPvVKCYd/ Cancel-Lock: sha1:c3L1VaoEoLZ4hBU6APB9OT8MdtA= sha256:bNnWmoK5F40TOa02rqUWquXizLUJt0Cd1rwOPt1H3C8= User-Agent: Pan/0.162 (Pokrosvk) Xref: csiph.com comp.os.linux.misc:77188 On Sun, 09 Nov 2025 11:25:36 +0000, Diego Garcia wrote: > Try to predict the weather using Python. You'll be getting tomorrows > forecast next week, or even next month. How about in a second or two? The starting point is url = f"https://api.weather.gov/points/{latitude},{longitude}" The JSON response is processed to get the grid id necessary to build a URL for the current observations, and to extract the URL for the forecast. THE JSON responses are processed and the relevant data is printed. It is 46 lines of Python including white space. Feel free to do it in C. Output: temperature 37.4 dewpoint 28.40 humidity 69.69 pressure 30.47 Today Patchy fog before 8am. Partly sunny, with a high near 45. West wind around 2 mph. temperature: 45 wind 2 mph W Tonight Patchy fog after 5am. Mostly cloudy, with a low around 32. East southeast wind 2 to 6 mph. temperature: 32 wind 2 to 6 mph ESE Monday Patchy fog before 8am, then a chance of rain. Partly sunny, with a high near 53. South southeast wind 2 to 8 mph. Chance of precipitation is 30%. temperature: 53 wind 2 to 8 mph SSE Monday Night A chance of rain before 5am. Mostly cloudy, with a low around 38. West wind 6 to 9 mph. Chance of precipitation is 30%. temperature: 38 wind 6 to 9 mph W Veterans Day Partly sunny, with a high near 56. West wind 2 to 6 mph. temperature: 56 wind 2 to 6 mph W Tuesday Night Mostly cloudy, with a low around 34. temperature: 34 wind 2 mph SSE Wednesday Mostly cloudy, with a high near 55. temperature: 55 wind 3 mph SSE Wednesday Night Mostly cloudy, with a low around 35. temperature: 35 wind 2 to 8 mph SE Thursday A chance of rain after 11am. Partly sunny, with a high near 57. temperature: 57 wind 7 mph SSE Thursday Night Rain likely. Mostly cloudy, with a low around 33. temperature: 33 wind 6 to 9 mph SSW Friday A chance of rain. Mostly cloudy, with a high near 46. temperature: 46 wind 6 to 9 mph W Friday Night A chance of rain before 11pm, then a chance of rain and snow. Mostly cloudy, with a low around 29. temperature: 29 wind 7 mph SW Saturday A chance of rain and snow. Partly sunny, with a high near 45. temperature: 45 wind 5 to 8 mph SSW Saturday Night A chance of rain before 5am, then a chance of rain and snow. Mostly cloudy, with a low around 29. temperature: 29 wind 3 to 7 mph SSW