Discuss Scratch

9876546789
Scratcher
81 posts

Should the logic of a Python program be seperated from a GUI (like Tk or CTk)?

I’m making a dB meter and an OpenAI based virtual assistant. Both have a GUI. Should they be seperated from the logic or should I keep them as is?

dB meter:
https://github.com/sserver224/DecibelMeter/blob/main/db_meter.py

Virtual assistant:
https://github.com/sserver224/OpenAI-Voice-Assistant/blob/main/openai_voice.py
bigspeedfpv
Scratcher
500+ posts

Should the logic of a Python program be seperated from a GUI (like Tk or CTk)?

yes they should be separated?
Redstone1080
Scratcher
1000+ posts

Should the logic of a Python program be seperated from a GUI (like Tk or CTk)?

Oh I honestly don't bother. That's why I don't upload my code to github…
ajskateboarder
Scratcher
1000+ posts

Should the logic of a Python program be seperated from a GUI (like Tk or CTk)?

Obviously! You should seperate the logic into functions in a seperate module. You might even want to follow Python's packaging guide

Redstone1080 wrote:

Oh I honestly don't bother. That's why I don't upload my code to github…
Good luck trying to improve other people's code

Powered by DjangoBB