Package psychopy :: Module core
[frames] | no frames]

Module core

source code

Basic functions, including timing, rush (imported), quit
Classes
  Clock
A convenient class to keep track of time in your experiments.
Functions
 
quit()
Close everything and exit nicely (ending the experiment)
source code
 
wait(secs, hogCPUperiod=0.2)
Wait for a given time period.
source code
 
shellCall(shellCmd, stderr=False)
Call a single system command with arguments, return its stdout.
source code
Variables
  runningThreads = []
  havePyglet = False
Function Details

wait(secs, hogCPUperiod=0.2)

source code 

Wait for a given time period.

If secs=10 and hogCPU=0.2 then for 9.8s python's time.sleep function will be used, which is not especially precise, but allows the cpu to perform housekeeping. In the final hogCPUperiod the more precise method of constantly polling the clock is used for greater precision.

If you want to obtain key-presses during the wait, be sure to use pyglet and to hogCPU for the entire time, and then call event.getKeys() after calling core.wait()

shellCall(shellCmd, stderr=False)

source code 
Call a single system command with arguments, return its stdout. Returns (stdout,stderr) if requested (by stderr==True). Does not handle multiple commands connected by pipes ("|").