Can I run the jl file without opening the JuliaStudio application through cmd?

Source: Internet
Author: User
Thank you for reading! Recently, I encountered a problem in the project. At first I wanted to use the PHP language to open julia's REPL environment and run a jl file, but it was not successful. You can run the PHP file on the command line, but the browser cannot. For more information, see my previous questions ---- & amp; gt;... Thank you for reading!
Recently, I encountered a problem in the project. At first I wanted to use the PHP language to open julia's REPL environment and run a jl file, but it was not successful. You can run the PHP file on the command line, but the browser cannot. For more information, see my previous question ----> link.
Considering that the REPL environment of julia may be called is different from that of common software, so it cannot be opened smoothly. Now, I want to use another method to change the idea:
We can see that PHP can use MATLAB called by CMD to run the m file. Both the PHP file running by the browser and the PHP file running by the command line can be perfectly implemented. You only need to use a command in the PHP file:
exec('matlab -nodesktop -minimize -r test')That's all. Test is the m file of matlab. In this way, I don't need to open the matlab software to run m files and perform operations.
Similarly, I now want to use JuliaStudio to run the jl file under the command line. However, Baidu and Google did not find the file similar to that in the Matlab command line. “-r”And other running parameters. Can Julia directly run the specified m file by calling the JuliaStudio software from CMD?
Thank you!

Reply content:

Thank you for reading!
Recently, I encountered a problem in the project. At first I wanted to use the PHP language to open julia's REPL environment and run a jl file, but it was not successful. You can run the PHP file on the command line, but the browser cannot. For more information, see my previous question ----> link.
Considering that the REPL environment of julia may be called is different from that of common software, so it cannot be opened smoothly. Now, I want to use another method to change the idea:
We can see that PHP can use MATLAB called by CMD to run the m file. Both the PHP file running by the browser and the PHP file running by the command line can be perfectly implemented. You only need to use a command in the PHP file:
exec('matlab -nodesktop -minimize -r test')That's all. Test is the m file of matlab. In this way, I don't need to open the matlab software to run m files and perform operations.
Similarly, I now want to use JuliaStudio to run the jl file under the command line. However, Baidu and Google did not find the file similar to that in the Matlab command line.“-r”And other running parameters. Can Julia directly run the specified m file by calling the JuliaStudio software from CMD?
Thank you!

If julia is not added to the environment variable path, run

Julia installation path/julia.exe your *. jl path/xxx. jl

If an environment variable has been added, it can be simplified:

Julia.exe your *. jl path/xxx. jl

For windows, open the JL file by clicking the right button and choose to open it directly with julia.exe.
In the future, you can double-click it to run it. However, you need to pause the code after the code, otherwise you will not see the output result,

run(`cmd /c pause`)

Or enter your *. jl path/xxx. jl in cmd and press Enter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.