Psychopy unresponsive after experiment

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2023.2.3 / Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Creating first serious experiment in the builder, and newbie at python, not other languages. Experiment runs fine first time after starting up Psychopy, but when re-running, then AFTER running the experiment, Psychopy increasingly often gets unresponsive (or extremely slow to return Builder/Runner/Coder windows). It is my impression that if I end the experiment with ‘Esc’, chances are smaller that it gets unresponsive. Thanks for help.

Try reducing the amount of post-processing by going to Experiment Settings / Data / Logging Level and set it to Error.

This helped, thanks. Still,questions remain: WHY does saving data take 10 to 20 minutes? Wild guesses: during saving at the end, PsychoPy generates new data that it also wants to save? Or has trouble opening or accessing files? Something like that…

Do you have a lot of print statements in your code, or next entry calls in each Frame?

10-20 minutes sounds extreme.

No, not many print statements nor action with each frame. I just set the Data Logging level to ‘exp’ again, as a test. Psychopy took 7 minutes to complete. During this time, the red ‘close’ cross in the upper right corner of the Runner window (unselected) was blinking, and the Builder window had ‘unresponsive’ in its header. The resulting log file was 36 Kb only. As said, when I set Logging level to ‘err’, completion time is fine.