Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Fix curdir error #363

Closed
wants to merge 1 commit into from

Conversation

Yancey1989
Copy link
Contributor

Fixed #359

Copy link
Collaborator

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第二课也有同样的问题,可以一起修复了。

@@ -494,7 +494,7 @@ def load_image(file):
return im

test_data = []
cur_dir = os.path.dirname(os.path.realpath(__file__))
cur_dir = os.path.dirname(os.path.realpath('__file__'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加了单引号后,就不是当前路径了。
可以考虑换成:

os.path.abspath(os.path.dirname(sys.argv[0]))

参考:https://www.blog.pythonlibrary.org/2013/10/29/python-101-how-to-find-the-path-of-a-running-script/

@luotao1
Copy link
Collaborator

luotao1 commented Sep 1, 2017

close due to #357

@luotao1 luotao1 closed this Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants