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

    Yes I realized that I put everything to two classes. It’s too much. I’ll make more classes for more attributes.

    I didn’t know enums until now and it’s awesome. I will do some exercises about it.

    Last thing is interesting. I need to read that. Thank you for suggestions.

    • solrize@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      There’s no need to make more classes. You can move some of the code so it’s not in any class.