darc_toolbox
darc_toolbox copied to clipboard
improve adding package folders to path
At the moment we have this
sys.path.insert(0, '../') # relative coding of 'up' two folders.
which is ok for the PsychoPy demo stuff. But it's fragile. When we copy/paste demo experiments to start new ones, then it's clumsy.
How
import sys
from os.path import expanduser
home = expanduser("~")
sys.path.insert(0, home + '/git-local/darc-experiments-python') # absolute path
But also add in a check that that path exists and give a meaningful error if not.
Note
This will become redundant (in the demo .psyexp experiments) once bad and darc are included as part of PsychoPy.