1
。 我已經看到了關於設置pty = False的缺陷,但它沒有幫助。 這裏是所有的,我已經試過了可能性:Python的面料 - 如何以靜默方式運行命令,而不是等待我想運行</p> <pre><code>run("flower -A app") </code></pre> <p>,並在後臺運行該Web應用程序,而無需等待輸出的輸出
## these methods blocked fabric:
run("flower -A app >& /dev/null < /dev/null &", pty=False)
with quiet():
run("nohup flower -A app")
run("nohup flower -A app>& /dev/null < /dev/null &"
## fabric waits for the stdout:
run("nohup flower -A app > /dev/null 2>&1")
## fabric is not blocked but the process is not started:
run("nohup flower -A app > /dev/null 2>&1 &")
run("flower -A {} app > /dev/null 2>&1 &")
with quiet():
run("flower -A app")
沒有人有任何其他建議,我可以試試嗎?
我有同樣的問題,你解決了嗎? – David
@David我最終從我的結構代碼中爲這類命令調用了paramiko。您可以將fabric的主機和private_key傳遞給paramiko。這不是太亂。我希望這有幫助。 – max
謝謝!我會嘗試paramiko – David