I am trying to use run () or success () to execute a Python script from Julia.
I can run it normally if I specify the command manually:
julia> run(`python sample.py`) woo! sample
However, if I try to start it with a string argument, it unexpectedly does not work.
julia> str = "python sample.py" "python sample.py" julia> run( `$str` ) ERROR: could not spawn `'python sample.py'`: no such file or directory (ENOENT) in _jl_spawn at process.jl:217 in spawn at process.jl:348 in spawn at process.jl:389 in run at process.jl:478
Specifying the full path for sample.py gives the same result. Oddly enough, python just works as a string:
julia> str = "python" "python" julia> run( `$str` ) Python 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
Am I doing something wrong?
thanks
source share