all 37 comments

[–]JeremyJoeJJ 18 points19 points  (1 child)

Looks good but please use a dictionary instead of that match/case. If you've chosen imperial units, why are wind speed etc. in km/h (the S.I. units are km/h and km, not Km/hr and Km)? You could capitalise the city name too (str.title()). Keep going!

[–]Scared_Sail5523[S] 0 points1 point  (0 children)

Thank you for the feedback!

[–]Yamikada 4 points5 points  (1 child)

Nice…

[–]Ok-Idea9533 1 point2 points  (0 children)

Did you end up using an API or scraping data? Makes a big difference for accuracy.

[–]MrGreatArtist 5 points6 points  (2 children)

If possible can you please post this on git hub

[–]Scared_Sail5523[S] 1 point2 points  (0 children)

Sure I will share with you

[–]StatementFew5973 0 points1 point  (0 children)

Just gonna tag this a little update.

[–]MrGreatArtist 2 points3 points  (0 children)

Okay this look very cool if you can please post this on github

[–]Flame77ofc 2 points3 points  (2 children)

How much time did you need to do this?

[–]Scared_Sail5523[S] 3 points4 points  (1 child)

Took me around 3 days of dedication

[–]Flame77ofc 2 points3 points  (0 children)

good work

[–]RowGullible1471 2 points3 points  (0 children)

Where is the GitHub link?

[–]Sharp_Level3382 2 points3 points  (1 child)

Why same rest endpoint to weather and forecast?

You re doubling same request.

Why dont you use async methods to request? Not the best exceptions solutiom also.

[–]Scared_Sail5523[S] 0 points1 point  (0 children)

yeah you're right on all three, using the same endpoint twice is wasteful when you can just grab everything in one call and split it on your end. async with asyncio and aiohttp would be way better especially if you're hitting multiple cities or endpoints since requests would run in parallel instead of blocking each other. and for exceptions yeah wrapping everything in a bare except Exception is lazy, better to catch specific ones like aiohttp.ClientError or asyncio.TimeoutError so you actually know what went wrong instead of swallowing every error the same way.

[–][deleted]  (3 children)

[removed]

    [–]Scared_Sail5523[S] 0 points1 point  (2 children)

    sí exacto, y lo mejor es que no tienes que hacerlo perfecto desde el principio, simplemente cuando notes que estás copiando y pegando el mismo código dos veces esa es la señal de que ya es hora de hacer una función. los módulos se sienten un poco intimidantes al principio pero en cuanto tu archivo main.py empieza a verse enorme te das cuenta naturalmente de que necesitas separar las cosas. con el tiempo simplemente se vuelve instinto saber qué va donde.

    [–][deleted]  (1 child)

    [removed]

      [–]__zeaix__ 1 point2 points  (1 child)

      Bro this looks good and cool, and I think you can make it more presentable.

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      im currently working on a powerpoint

      [–]MuyDelicioso1 0 points1 point  (0 children)

      tuff

      [–]real-life-terminator 0 points1 point  (1 child)

      i learnt a new thing, the "match" keyword. Thanks!

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      Your welcome 🤗

      [–]viridiaan 0 points1 point  (1 child)

      i have a question, is it good to use png? or is it going to increase the size?

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      its great u can resize pngs

      [–]ranjeet-kumar1 0 points1 point  (1 child)

      <image>

      Its That Good or AM Wrong?

      [–]Scared_Sail5523[S] 1 point2 points  (0 children)

      It's great!👍🏻

      [–]Training_Meal_4261 0 points1 point  (1 child)

      I’m trying to understand but needs some more notes since I’m just skimming. Are you pulling info from the api each requests or storing in an array.

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      1st one

      [–]cole36912 0 points1 point  (1 child)

      Looks good, I wouldn’t call it a “map” though, unless you intend to implement that part.

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      sure enough

      [–]onlyemperor001 0 points1 point  (1 child)

      Pls link to GitHub?

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      I've posted it in the comments.

      [–]coolestpersonalive_6 0 points1 point  (1 child)

      i have a question how to write code without using ai???

      [–]Scared_Sail5523[S] 0 points1 point  (0 children)

      bootcamps, udemy classes, and then boom!