gpt4 book ai didi

shell - 在 Julia 中运行 Windows shell 命令

转载 作者:行者123 更新时间:2023-12-04 14:09:30 25 4
gpt4 key购买 nike

据说在 Julia 中,我可以通过首先点击 ; 来运行 shell 命令。 .但是我在我的 Windows 7 机器上没有运气。这是我第一次运行 dir 的示例在 shell 中,然后尝试在 Julia 中执行相同的操作:

C:\Users\Public>dir
Volume in drive C is OS
Volume Serial Number is A4A2-4168

Directory of C:\Users\Public

01/30/2016 03:31 AM <DIR> .
01/30/2016 03:31 AM <DIR> ..
07/13/2009 09:08 PM <DIR> Documents
07/13/2009 08:54 PM <DIR> Downloads
01/02/2017 10:56 AM <DIR> Music
01/16/2016 02:53 PM 262,144 NTUSER.DAT
07/13/2009 08:54 PM <DIR> Pictures
11/20/2010 11:16 PM <DIR> Recorded TV
01/05/2016 06:06 AM <DIR> Roaming
07/13/2009 08:54 PM <DIR> Videos
1 File(s) 262,144 bytes
9 Dir(s) 850,167,861,248 bytes free

C:\Users\Public>julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32

shell> dir
ERROR: could not spawn `dir`: no such file or directory (ENOENT)
in _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::RawFD, ::RawFD, ::RawFD) at .\process.jl:3
21
in #414 at .\process.jl:478 [inlined]
in setup_stdio(::Base.##414#415{Cmd,Ptr{Void},Base.Process}, ::Tuple{RawFD,RawFD,RawFD}) at .\process.jl:466
in #spawn#413(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{RawFD,RawFD,RawFD}, ::Bool, ::Bool) at .\pr
ocess.jl:477
in run(::Cmd) at .\process.jl:591
in repl_cmd(::Cmd, ::Base.Terminals.TTYTerminal) at .\client.jl:91

julia>

我试过其他命令,cd 有效,但 cls 无效。这里出了什么问题?

最佳答案

这有效:

shell>cmd /c dir

关于shell - 在 Julia 中运行 Windows shell 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41645397/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com