Julia源文件的路径应该是什么?

时间:2016-05-09 13:27:06

标签: macos julia

我在/Users/myuser/Documents/JuliaLearn/Julia/mysource.jl

有一个.jl文件

在Julia Repl,我试图以:

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

但是得到这个错误:

  

错误:无法打开文件   /Users/myuser/~/Documents/JuliaLearn/Julia/mysource.jl in include at   /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib   在include_from_node1中   /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib

我也试过但得到类似上面的错误:

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

知道我做错了吗?

1 个答案:

答案 0 :(得分:1)

与OS同构:

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

include("your_julia_file.jl")