Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve adding package folders to path #78

Open
drbenvincent opened this issue Feb 24, 2019 · 0 comments
Open

improve adding package folders to path #78

drbenvincent opened this issue Feb 24, 2019 · 0 comments
Labels

Comments

@drbenvincent
Copy link
Owner

drbenvincent commented Feb 24, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant