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

Conversation

@Yancey0623
Copy link
Contributor

Fixed #359

@Yancey0623 Yancey0623 requested review from gangliao and luotao1 August 9, 2017 06:33
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.

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


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.

2 participants