【发布时间】:2019-04-03 08:57:05
【问题描述】:
当我在VScode中使用jupyter扩展并在jupyter中运行一行代码以使用相对路径保存文件时,我在另一个文件中找到了文件(iris_tree.dot)。就像我在另一个文件路径中调试/运行代码一样。如何设置 jupyter runner 的正确路径?
#%%
from sklearn.tree import export_graphviz
export_graphviz(
tree_clf,
out_file="iris_tree.dot",
feature_names=iris.feature_names[2:],
class_names=iris.target_names,
rounded=True,
filled=True
)
【问题讨论】:
-
检查一下stackoverflow.com/a/56091981/6875391,我更改了设置“python.terminal.executeInFileDir”(Ctrl+Shift+P 搜索“用户设置”然后搜索“python.terminal.executeInFileDir”)和看起来 pypath 已更新
标签: python visual-studio-code jupyter