psychopy.app
- the PsychoPy® application suite¶This module contains everything needed to run and manage the wxPython PsychoPy® GUI application suite (e.g., Coder, Builder and Runner).
The functions presented here provide a simple interface to the PsychoPy® application instance and any frames associated with it. This interface is intended for unit testing the GUI and for developers wishing to extend it.
|
Start the PsychoPy GUI. |
|
Quit the running PsychoPy application instance. |
Check if the GUI portion of PsychoPy is running. |
|
Get a reference to the PsychoPyApp object. |
|
|
Get the reference to one of PsychoPy's application frames. |
Start the PsychoPy GUI.
This function is idempotent, where additional calls after the app starts
will have no effect unless quitApp() was previously called. After this
function returns, you can get the handle to the created PsychoPyApp
instance by calling getAppInstance()
(returns None otherwise).
Errors raised during initialization due to unhandled exceptions with respect to the GUI application are usually fatal. You can examine ‘last_app_load.log’ inside the ‘psychopy3’ user directory (specified by preference ‘userPrefsDir’) to see the traceback. After startup, unhandled exceptions will appear in a special dialog box that shows the error traceback and provides some means to recover their work. Regular logging messages will appear in the log file or GUI. We use a separate error dialog here is delineate errors occurring in the user’s experiment scripts and those of the application itself.
showSplash (bool) – Show the splash screen on start.
testMode (bool) – Must be True if creating an instance for unit testing.
safeMode (bool) – Start PsychoPy in safe-mode. If True, the GUI application will launch with without loading plugins.
startView (str, None) – Name of the view to start the app with. Valid values are ‘coder’, ‘builder’ or ‘runner’. If None, the app will start with the default view or the view specifed with the PSYCHOPYSTARTVIEW environment variable.
Quit the running PsychoPy application instance.
Will have no effect if startApp() has not been called previously.
Check if the GUI portion of PsychoPy is running.
True if the GUI is started else False.
Get a reference to the PsychoPyApp object.
This function will return None if PsychoPy has been imported as a library or the app has not been fully realized.
Handle to the application instance. Returns None if the app has not been started yet or the PsychoPy is being used without a GUI.
PsychoPyApp or None
Examples
Get the coder frame (if any):
import psychopy.app as app
coder = app.getAppInstance().coder
Get the reference to one of PsychoPy’s application frames. Returns None if the specified frame has not been fully realized yet or PsychoPy is not in GUI mode.
frameName (str) – Identifier for the frame to get a reference to. Valid names are ‘coder’, ‘builder’ or ‘runner’.
Reference to the frame instance (i.e. CoderFrame, BuilderFrame or RunnerFrame). None is returned if the frame has not been created or the app is not running. May return a list if more than one window is opened.
object or None