运行Julia .jl文件 [英] Running Julia .jl files

查看:438
本文介绍了运行Julia .jl文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是julia的新手,刚刚完成了我的第一个程序.我在julia-studio中编写了代码,并已在该程序中对其进行了测试.它给了我所有正确的输出,但是外壳程序将输出分开,就好像它是两个不同的执行一样.

I'm new to julia and just finished my first program. I wrote the code in julia-studio and have been testing it within that program. It gives me all of the correct output, but the shell separates the output as if it is two different executions.

我想知道编译器是否有问题,所以我想尝试在julialang.org上的默认julia shell中进行编译.

I'm wondering if it's a problem with my compiler, so I thought I would try compiling it in the default julia shell found at julialang.org.

但是,我无法理解和/或弄清楚如何在此运行它.我当前的程序从同一目录中的另一个文件读取输入,并输出结果.

However, I cannot understand and/or figure out how to run it there. My current program reads input from another file in the same directory and outputs the results.

任何人都可以解释如何运行该程序.此 http://julia.readthedocs.org/en/latest/manual/getting-started/对我来说没有意义.

Can anyone explain how to run the program. This http://julia.readthedocs.org/en/latest/manual/getting-started/ isn't making sense to me.

示例输出:

 julia> program
 #
 #
 #
 #


 julia> 
 #
 #
 #
 #
 #

#代表整数.理想情况下,输出不应以"julia>"分隔.

The # represents integer numbers. Ideally the output should not be seperated by "julia>"

推荐答案

如果要从命令行运行julia脚本,则只需

If you want to run the julia script from a command line then just do

/path/to/julia script-name.jl

在您选择的外壳中.

如果您想从julia repl中运行它,那么您将需要这样的东西:

If you want to run it from the julia repl then you want something like so:

julia> include("path/to/script-name.jl")

关于为什么您的输出如此拆分,我认为我们需要查看您的代码.

As to why your output is split like that I think we would need to see your code.

这篇关于运行Julia .jl文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆