我有一个等效的 shell 命令(如下所示),我试图在 linux 机器上使用 call 命令从 python 脚本“按原样”运行并遇到编译错误,除了调用 runt 这个命令之外,还有更好的方法吗?我哪里错了?
from subprocess import call
def main ():
#ssh -p 29418 company.com gerrit query --commit-message --files --current-patch-set status:open project:platform/vendor/company-proprietary/wlan branch:master |grep refs| awk -F ' ' {'print $2'} |tee refspecs.txt
call (["ssh -p 29418 company.com gerrit query", "--commit-message", "--files", "--current-patch-set", "status:open project:platform/vendor/company-proprietary/wlan branch:master","|grep refs| awk -F ' ' {'print $2'} |tee refspecs.txt")]
if __name__ == '__main__':
main()