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

  • citizen@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    I revised the code. Added some spaces and comments for better readability. Hope it’s better now.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      Instead you should just use an autoformatter. Black is good. Ruff is probably good too but I don’t have a lot of experience with it. YAPF is not good; don’t use it.