Skip to content

Use os.pardir when modifying sys.path #10

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

Merged
merged 1 commit into from
Nov 28, 2016

Conversation

hnakamur
Copy link
Contributor

In the book and the other source codes except ch05/train_neuralnet.py uses

sys.path.append(os.pardir)

but ch05/train_neuralnet.py uses

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

to add the parent directory to sys.path.

With this fix, you can run exec(open('train_neuralnet.py').read()) successfully on Python3 prompt in ch05 directory.

@koki0702 koki0702 merged commit 92bc059 into oreilly-japan:master Nov 28, 2016
@koki0702
Copy link
Collaborator

Thank you!

SaFuse added a commit to SaFuse/deep-learning-from-scratch that referenced this pull request Aug 29, 2017
Use os.pardir when modifying sys.path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants