如何等到实时输出开始在子进程中的控制台上?

时间:2017-11-07 12:42:42

标签: python windows console subprocess

UseCase:

在Windows CMD shell中调用命令。等到输出(日志)开始进入控制台。控制台上的输出(日志)不得在后台运行。

import subprocess 
from subprocess import CREATE_NEW_CONSOLE
command="cmd /K appium -p 4723"
#This open a new cmd shell for above command
proc=Popen(command,creationflags=CREATE_NEW_CONSOLE)
#Need to write further code , based on wait till the logging started

预期: 想要等到控制台上的日志记录开始

登录控制台。

[Appium] Welcome to Appium v1.7.0
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.

0 个答案:

没有答案