摘要: 代码写好之后拿到别人的电脑上,就不能运行了。这是因为参照物在变,换句话说就是路径变了。我们要针对性的写一个获取路径的方法: import os BASE_PATH = os.path.dirname(os.path.abspath(__file__)) print(BASE_PATH) import 阅读全文