What should path be to Julia source file?

ⅰ亾dé卋堺 提交于 2020-01-17 13:48:09

问题


I have a .jl file at /Users/myuser/Documents/JuliaLearn/Julia/mysource.jl

In Julia Repl, I'm trying to run as:

include("/Users/myuser/Documents/JuliaLearn/Julia/mysource.jl")

But get this error:

ERROR: could not open file /Users/myuser/~/Documents/JuliaLearn/Julia/mysource.jl in include at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib in include_from_node1 at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib

I also tried but get an error similar to the above:

include("~/Documents/JuliaLearn/Julia/mysource.jl")

Any idea what I'm doing wrong?


回答1:


Isomorphic to OS:

cd(joinpath(homedir(),"a_long","path","to_your","files"));

include("your_julia_file.jl")


来源:https://stackoverflow.com/questions/37117020/what-should-path-be-to-julia-source-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!