使用 PyDev-project 在 Eclipse 3.8.1 中配置工作目录
Configuring the working directory in Eclipse 3.8.1 with PyDev-project
我正在 Eclipse 3.8.1 中尝试 运行 python 脚本,但我不断收到错误消息:
IOError: [Errno 2] No such file or directory
问题出现在代码行:
train_labels = np.loadtxt("./examples/data/class_train.labels")
这是我的项目的截图:
相对路径似乎是从脚本本身的位置开始的,而我希望相对路径是从项目的根目录开始的,也就是你在图片中看到的 RLScore 文件夹。
我该如何配置?
P.S。我不想编辑代码,因为这不是我自己的代码,我需要对发行版中的许多其他文件进行编辑。
尝试:
train_labels = np.loadtxt("../data/class_train.labels")
我正在 Eclipse 3.8.1 中尝试 运行 python 脚本,但我不断收到错误消息:
IOError: [Errno 2] No such file or directory
问题出现在代码行:
train_labels = np.loadtxt("./examples/data/class_train.labels")
这是我的项目的截图:
相对路径似乎是从脚本本身的位置开始的,而我希望相对路径是从项目的根目录开始的,也就是你在图片中看到的 RLScore 文件夹。
我该如何配置?
P.S。我不想编辑代码,因为这不是我自己的代码,我需要对发行版中的许多其他文件进行编辑。
尝试:
train_labels = np.loadtxt("../data/class_train.labels")