为了账号安全,请及时绑定邮箱和手机立即绑定

如何从python内部调用安装在linux上的程序?

如何从python内部调用安装在linux上的程序?

慕勒3428872 2021-03-29 17:10:29
这就是我一直在尝试的def test():    import sys    import subprocess    file1 = open(sys.argv[1],"r") #this is the input to fastacmd    idx = file1.readlines()    outname = idx[0].split("\r\n")[0]    foutname = outname + "_f_output"    astaseq = subprocess.call(["fastacmd","-i", file1, "-o",foutname])    blastresult = subprocess.call(["blastp", "-db", "db1.faa", "-query", foutname, "-out", outname])但是我被抓住了,我真的无法理解File "test.py", line 16, in <module>    fastacmd_blastp()  File "test.py", line 11, in test    fastaseq = subprocess.call(["fastacmd","-i", file1, "-o",fastaoutname])  File "/usr/local/lib/python2.7/subprocess.py", line 486, in call    return Popen(*popenargs, **kwargs).wait()  File "/usr/local/lib/python2.7/subprocess.py", line 672, in __init__    errread, errwrite)  File "/usr/local/lib/python2.7/subprocess.py", line 1202, in _execute_child    raise child_exceptionTypeError: execv() arg 2 must contain only strings有人可以帮忙吗?谢谢
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 139 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信