I don’t know if it’s the true place to ask, apologizing if not. I started to python one and half week ago. So I’m still beginner.

I made a terminal based weather application with python. What do you think about the code, is it good enough? I mean is it professional enough and how can I make the same functions with more less code?

Here’s the main file (I also added it as url to post): https://raw.githubusercontent.com/TheCitizenOne/openweather/refs/heads/main/openweather.py
Here’s the config.json file: https://raw.githubusercontent.com/TheCitizenOne/openweather/refs/heads/main/config.json

  • citizenOP
    link
    fedilink
    32 months ago

    Oops, sorry. I will revise the code and place spaces. Thanks for suggestion <3

    • @taaz@biglemmowski.win
      link
      fedilink
      English
      7
      edit-2
      2 months ago

      Usually, you would use a formatter anyway - it’s good to know the standard way but for day to day coding I just have a shortcut bound that runs ruff format (you can even have it done automatically on file save).

      • citizenOP
        link
        fedilink
        12 months ago

        I need to search formatters. Thank you for suggestion.

    • @Derp@lemmy.ml
      link
      fedilink
      52 months ago

      Not the original commenter, but no need to apologise my friend. Nice work. Learning tip from me: give PEP 8 a read and save it for reference somewhere. It’s the standard for how to format Python code, and future you will thank you for internalising it early on in your Python journey