<tfoot id='sqWEP'></tfoot>

    1. <legend id='sqWEP'><style id='sqWEP'><dir id='sqWEP'><q id='sqWEP'></q></dir></style></legend>

        <small id='sqWEP'></small><noframes id='sqWEP'>

      1. <i id='sqWEP'><tr id='sqWEP'><dt id='sqWEP'><q id='sqWEP'><span id='sqWEP'><b id='sqWEP'><form id='sqWEP'><ins id='sqWEP'></ins><ul id='sqWEP'></ul><sub id='sqWEP'></sub></form><legend id='sqWEP'></legend><bdo id='sqWEP'><pre id='sqWEP'><center id='sqWEP'></center></pre></bdo></b><th id='sqWEP'></th></span></q></dt></tr></i><div id='sqWEP'><tfoot id='sqWEP'></tfoot><dl id='sqWEP'><fieldset id='sqWEP'></fieldset></dl></div>
          <bdo id='sqWEP'></bdo><ul id='sqWEP'></ul>

        python subprocess.call() “没有这样的文件或目录"

        时间:2023-07-21

          <legend id='7urOp'><style id='7urOp'><dir id='7urOp'><q id='7urOp'></q></dir></style></legend>

                <small id='7urOp'></small><noframes id='7urOp'>

                  <tbody id='7urOp'></tbody>
              1. <i id='7urOp'><tr id='7urOp'><dt id='7urOp'><q id='7urOp'><span id='7urOp'><b id='7urOp'><form id='7urOp'><ins id='7urOp'></ins><ul id='7urOp'></ul><sub id='7urOp'></sub></form><legend id='7urOp'></legend><bdo id='7urOp'><pre id='7urOp'><center id='7urOp'></center></pre></bdo></b><th id='7urOp'></th></span></q></dt></tr></i><div id='7urOp'><tfoot id='7urOp'></tfoot><dl id='7urOp'><fieldset id='7urOp'></fieldset></dl></div>
                <tfoot id='7urOp'></tfoot>
                  <bdo id='7urOp'></bdo><ul id='7urOp'></ul>
                  本文介绍了python subprocess.call() “没有这样的文件或目录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在模块上发现了一些问题,但更常见的问题似乎是我认为我已经管理的参数列表正确(最终)

                  I've found a few questions on the module but the more common problem seems to be getting the argument list right which I think I have managed (eventually)

                  我正在尝试运行一个程序,该程序需要在命令行中输入这样的输入,

                  I am trying to run a program that expects an input like this in the command line,

                  fits2ndf in out
                  

                  'in' 是要转换的文件的文件路径,'out' 是保存结果的路径和文件名.

                  with 'in' being the filepath of the file to be converted and 'out' being the path and filename to save the result to.

                  所以使用子进程,

                  subprocess.call(["fits2ndf","/media/tom_hdd/Transfer/reference.fits","/media/tom_hdd/Transfer/reference.sdf"])
                  

                  这引发了,

                  Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                  File "/usr/lib/python2.7/subprocess.py", line 493, in call
                  return Popen(*popenargs, **kwargs).wait()
                  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
                  errread, errwrite)
                  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
                  raise child_exception
                  OSError: [Errno 2] No such file or directory
                  

                  设置 shell=TRUE (我知道这是不好的)会产生相同的结果.不确定它是否相关,但我正在使用 tcsh.有什么建议吗?

                  Setting shell=TRUE (which I know is bad) produces the same result. Not sure if it is relevant but I am using tcsh. Any suggestions?

                  根据问题进行编辑

                  我没有永久设置 PATH,但是 fits2ndf 是我使用初始化的程序包的一部分

                  I haven't permanently set the PATH however fits2ndf is part of a package of programs which I initialize using

                  % tcsh
                  % setenv STARLINK_DIR  /home/tomq/star-kapuahi
                  % source $STARLINK_DIR/etc/login
                  % source $STARLINK_DIR/etc/cshrc
                  

                  并且通常在任何目录中都可以在不指定完整路径的情况下工作.

                  and normally works from within any directory without specifying the full path.

                  推荐答案

                  whichfits2ndf会告诉你fits2ndf的路径.

                  which fits2ndf will show you the path of fits2ndf.

                  之后,您可以编写代码的完整路径,它应该可以工作.

                  After that you can write given full path to your code and it should work.

                  例如:

                  ~$ which mv
                  /bin/mv
                  

                  我的python代码:

                  My python code:

                  import subprocess
                  
                  subprocess.call(["/bin/mv","/tmp/a","/tmp/b"])
                  

                  这篇关于python subprocess.call() “没有这样的文件或目录"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将 subprocess.Popen 输出附加到文件? 下一篇:忽略 subprocess.Popen 的输出

                  相关文章

                      <bdo id='wsPCd'></bdo><ul id='wsPCd'></ul>
                  1. <i id='wsPCd'><tr id='wsPCd'><dt id='wsPCd'><q id='wsPCd'><span id='wsPCd'><b id='wsPCd'><form id='wsPCd'><ins id='wsPCd'></ins><ul id='wsPCd'></ul><sub id='wsPCd'></sub></form><legend id='wsPCd'></legend><bdo id='wsPCd'><pre id='wsPCd'><center id='wsPCd'></center></pre></bdo></b><th id='wsPCd'></th></span></q></dt></tr></i><div id='wsPCd'><tfoot id='wsPCd'></tfoot><dl id='wsPCd'><fieldset id='wsPCd'></fieldset></dl></div>

                  2. <tfoot id='wsPCd'></tfoot>

                    1. <legend id='wsPCd'><style id='wsPCd'><dir id='wsPCd'><q id='wsPCd'></q></dir></style></legend>

                      <small id='wsPCd'></small><noframes id='wsPCd'>