Wait for function to return?
Hi all
I want to stop the execution of my script until a function returns. The idea is to stop the script when starting a task, where the user has to press a key (P), and as soon as he presses the key, the script should continue. Code:
class Experiment: yield self.test_reaction_time() or self.viztask.schedule(self.test_reaction_time()) but somehow this doesn't do what I need... Thanks very much for help! Josh |
Please, this is very important for me... Anyone??
|
*Push* (I'm sorry, but it's very important that I get this to work asap)
|
Exactly *what* does not work? On which line does the program do other than you expect it to do?
Following changes might not work, but at least it should call test_reaction_time() correctly. Issue is that end_green_face_task() will run at the same time (I think). You can move that method call to test_reaction_time() as well, but why do you need a viztask for a key event? You can also register the P button with the function end_green_face_task() Code:
class Experiment: |
I believe the following code should do what you want:
Code:
class Experiment: |
All times are GMT -7. The time now is 09:21 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC