# Python not responding at the end of the experiment and weird data structure

**URL:** <https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103>\
**Category:** Builder\
**Created:** [July 20, 2022, 5:37pm UTC](https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103 "2022-07-20T17:37:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengsili](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mengsili](https://discourse.psychopy.org/u/mengsili)\
**Post date:** [July 20, 2022, 5:37pm UTC](https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103/1 "2022-07-20T17:37:37Z")

</div>

**OS** (e.g. Win10): Win10  
**PsychoPy version** (e.g. 1.84.x): 2022.2.1  
**Standard Standalone? (y/n)** If not then what?: y

Hi all,

I’m working on an experiment right not. It works fine for the first 5 subjects, and then suddenly _**I kept seeing ‘Python is not responding (see screenshot below)’ at the very end of the experiment**_. Before and after this I did NOT change anything in the script. _**Weirdly, when seeing this, the output data SOMETIMES (not for all) had different structures from before, although I did get complete data**_–I have a loop in my experiment, and there used to be an empty line after each loop, but when ‘Python is not responding’ at the end, there was no empty line after each loop.

 ![NOTRESPOND](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/9/69f04ea5cda722ba5d0d7271e0ecbcf53511313f.png)

I tried to reinstall PsychoPy but that did not help. I have no idea what may cause this so I’d appreciate any suggestion to debug! Thanks so much!

Data before the error, with empty lines after each loop

 ![Screen Shot 2022-07-20 at 10.34.57 AM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/9/e99134bb8ed6b225203182aa6e0d1c311c6eb492.jpeg)

Data after the error, some data with no empty lines after each loop

 ![Screen Shot 2022-07-20 at 10.35.23 AM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/2/c2c45fe084e966857048dc15c26c0d429a089f5e.jpeg)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 21, 2022, 6:20am UTC](https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103/2 "2022-07-21T06:20:48Z")

</div>

Is this related to the assigned participant number? Do you have any code that refers to expInfo[‘participant’] ?

Do you have concentric loops? The blank lines look like the behaviour when isTrials is ticked for both the outer and the inner loop.

---

<div class="post-metadata">

**Author:** ![mengsili](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mengsili](https://discourse.psychopy.org/u/mengsili)\
**Post date:** [July 21, 2022, 5:22pm UTC](https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103/3 "2022-07-21T17:22:34Z")

</div>

Hi Wakefield–thanks so much for your reply!  
You are right I double checked the data structure. It is because I have a nested loop with two inner loops, and ‘istrials’ was checked for one but not the other. I checked both of them and hopefully now I got consistent data structures. But somehow I still saw ‘python not responding’ at the end-all else works fine. I will carefully check all the codes again.

---

<div class="post-metadata">

**Author:** ![mengsili](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mengsili](https://discourse.psychopy.org/u/mengsili)\
**Post date:** [November 18, 2022, 5:52am UTC](https://discourse.psychopy.org/t/python-not-responding-at-the-end-of-the-experiment-and-weird-data-structure/30103/4 "2022-11-18T05:52:23Z")

</div>

Hi all-- I want to update on this issue. I got this “python not responding” issue for a new study recently and I figured out it is because I printed too many things. So comment out your “print” statements if you don’t need them if you have the same problem.
