-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a Awesome GUI calculator. #1987
Conversation
NitkarshChourasia
commented
Sep 30, 2023
- Removed a documentation site I was working on, to teach python programming language, for now, removed it as I was still working on it.
- Added an Awesome Tkinter made GUI based, calculator.
@sarayusreeyadavpadala @OfficialAhmed |
@sarayusreeyadavpadala @OfficialAhmed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOP is always recommended for GUI / more complex programs. It's easier to maintain and fix bugs using OOP implementation. On top of that, the global variables in Python considered bad practice especially if it's a big project containing multiple files and folders, it's prone to errors more often using globals in Python. Just wanted to share these notes they may be helpful in the next projects. But overall Great work you did good 👍🏻
@OfficialAhmed |
OOP is always recommended for GUI / more complex programs. It's easier to maintain and fix bugs using OOP implementation. On top of that, the global variables in Python considered bad practice especially if it's a big project containing multiple files and folders, it's prone to errors more often using globals in Python. Just wanted to share these notes they may be helpful in the next projects. But overall Great work you did good 👍🏻 @OfficialAhmed
|
@OfficialAhmed The only way to run them is declare root as global. |
This is why OOP is easier in this case
In your case only one global is set but as you add more features you'll realize adding more globals is the only way. thats where it starts to get complicated and difficult to handle bugs |
"""python class Environment:
""" You can see in this implementation I needed 4 variables to share between multiple functions without OOP the only way is through globals and this is few functions... more functions more globals |
So using class is the way. Okay. |