psychopy.org | Reference | Downloads | Github

Trialhandler issues have rendered PsychoPy script unusable

Hi,

I tried creating a script in code viewer that would allow me to set a criteria for how many practice trials a participant needs to get right before progressing.

The script appears to be having issues in regards to the trialhandler. I made several tweaks to try and solve this problem and now the script crashes when I launch it. I tried deleting my applicationdata files but that doesn’t solve the problem.

I’ve added my script here in the hopes that someone could show me how to fix it. I would be really appreciative if anyone could help me.

Thanks,

Josh

Coder_View_For_Life.py (8.3 KB)

Hi Josh, you haven’t actually said what the problem is.

If you want to reference a previous post, you should include a link to it, because within a few days it will become very difficult to find for future readers.

Hi Daniel,

The script starts to run and then goes to a black screen which is inescapable unless I log out/restart/turn off my computer.

I was hoping someone could tell me how to fix this. There’s only loop in the script currently but even when I remove it, I still get the same problem.

Thanks,

Josh

Hi Josh, the thing is, there are a million potential ways things can go wrong, and that’s why in the posting guidelines we ask for certain basic information. Like what operating system are you using? What version of psychopy are you using? Did you get an error message, and what was it? We need you to copy the whole thing if so. Since we all have different machines, one can’t expect we’ll all get the same error, so uploading a script with little to no information will not result in helpful answers. Let us know a little more information, and if I can, I’ll be happy to help.

Hi Daniel,

I’m not getting any error messages. It’s quite literally I go to run the script, my screen turns black and it’s stuck like that unless I log off/restart/turn off my laptop. I’m using the latest versiom of PsychoPy. What I’m trying to figure out is what the problem could be that causing this blackout.

Thanks,

Josh

OK great, what operating system do you have and what version of psychopy do you have?

Hi Daniel,

Windows10, 64 bit and the latest version of PsychoPy.

Thanks,

Josh

Hello Josh,

It doesn’t run without a conditions file, I just put together a random excel sheet because I didn’t find anything in your script that actually seemed like it needed one.

One issue is that it seems like you never call win.flip() outside of certain conditions, so the stimuli are never actually shown, and the while loop just keeps chugging along forever.

To avoid things locking up, you can set fullscr=False on the window while testing.

Hi Daniel,

I have it in the practice trials routine to import a spreadsheet so I don’t understand why it’s not doing so.

Could you elaborate further about the win.flip() point you’ve made please? As I understand it, you’re meant to put win.flip() whenever the parameters for moving from one routine to another have been met (i.e. press spacebar).

Thanks for all your help!

Josh

The issue was you didn’t upload the spreadsheet, so it had nothing to import.

I’m not the best person to ask about when or when to not flip the window if accurate timing is critical, it’s something I have to learn more about, but this I do know: You won’t see anything or any changes until the window is flipped. Calls to .draw() will draw the stimuli, but they won’t actually be seen by the user until you .flip(). I think the name is pretty apt, it’s as if an artist were sitting across from you drawing on a notepad, and then flips it over when done so you can see it.