我正在尝试将以下 ssh 命令转换为 python 代码,我能够转换为 python 但 python 代码没有给出任何输出,所以我认为我没有正确转换它,尤其是布尔“AND”逻辑..任何人都可以指出这里有什么问题?
ssh -p 29418 company.com gerrit query --current-patch-set --commit-message --files 'status:open project:platform/code branch:master label:Developer-Verified=1 AND label:Code-Review>=1'
Python代码:-
with open(timedir + "/ids.txt", "wb") as file:
check_call("ssh -p 29418 company.com "
"gerrit query --commit-message --files --current-patch-set "
"status:open project:platform/code branch:master label:Developer-Verified=1 AND label:Code-Review>=1 |"
"grep refs |"
"cut -f4 -d'/'",
shell=True, # need shell due to the pipes
stdout=file) # redirect to a file