#π Animation won't play
16 messages Β· Page 1 of 1 (latest)
Click here to see this code in our pastebin.
@topaz jay
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Try adding logging or some print statements to check the code flow and why it is not triggering the block of code you want
Setting self.counter to 0 at the top of the update method seems off. Do you really intend to reset self.counter ever update? How will it ever reach 10?
oooooh bruh. Thanks for pointing it out
When debugging something like this, besides the logging the other person suggested (logging counter, the main variable involved, would have pointed out the problem), look at each line of the function and say what its purpose is. If you had done that for the update function, you would have said "reset self.counter to 0" on the second line in, and that may have tipped you off.
This is typicaly called "rubber duck debugging".
thanks again ill try to use it in the future
You're welcome.
@topaz jay FYI, all the global statements you're using are unnecessary.
it's not really a project i'll continue working on so it doesn't really change much
Ok, I just thought I'd point that out. A lot of people misunderstand how global works.
I'm a begginer so I prob also don't know how it fully works, for me rn it's about making the program work no matter how the code looks
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.