Jul-10-2024, 06:20 PM
For your issue with the image not loading, the problem is likely due to the new image being garbage collected because there's no reference to it. You can fix this by keeping a reference to the new image in your helloworld function. Regarding your other questions, destroying and creating widgets is one way to do it, but another approach could be to update the existing widget instead of destroying it. For example, you can change the label's image without destroying it. As for managing long files, yes, keeping each game's code in separate files is a good practice. You can use Python modules to organize your code better. For example, you can have each game's code in a separate file and import the necessary functions or classes into your main file. This keeps your main file clean and manageable. A proper coder would definitely modularize the code for maintainability.