#๐Ÿ”’ Pygame freezing\ not responding

25 messages ยท Page 1 of 1 (latest)

violet vine
#

Iโ€™m new to python and when I make a script with pygame it always freezes after few seconds

native skiffBOT
#

@violet vine

Python help channel opened

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.

sturdy nimbus
#

show code if possible

violet vine
#

I hate this code

#

Now it works

#

It used to not work

#

Right after

#

Damn

#

โ€ฆ

inner sphinx
#

Could it be some random generated value causing an infinite loop? Are you using random? Did you use any controls right before the last time it froze?

#

Try to break down in as much detail las you can what led up to the freeze, and was the whole window frozen (you can't close with the x button) or just the graphics?

violet vine
old nebula
#

And/or show the code since we could probably identify what's blocking in your code.

violet vine
#

The code is working now but I will try to make a pygame I usually do basic etc

inner sphinx
#

Who knows, it might freeze again

violet vine
#

Maybe

old nebula
#

Just remember that you can't do lots of work on the UI thread. You can't have loops that run for a long time doing lots of work or things like waiting for network calls. Everything you do on the UI thread needs to be as fast as possible, or else the UI doesn't have an opportunity to respond to clicks and such.

sturdy nimbus
#

anyways you can ask again

#

!close for now

violet vine
#

Wait Iโ€™m writing it rn and wil connect my laptop my discord

#

Ok

#

!close

native skiffBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.