I have already tried a couple of things to get a live output from Popen. In my example, I try to get a output from steamcmd. The output comes, but it's very late and is in "blocks" not per line.
The current code looks so:
def call2(cmd, dir=None):
if dir is None:
dir = getScriptPath()
p = sub.Popen(cmd, shell=True, stdout=sub.PIPE, bufsize=1, cwd=dir)
for line in iter(p.stdout.readline, b''):
print(line),
p.stdout.close()
p.wait()
utils.call2("./steamcmd.sh +login anonymous +force_install_dir %s +app_update 376030 +quite" % dir, main.p_steam)
I tried another piece of code but it has the same problem. Seems that this is a specific steamcmd issue but when I call that over the terminal manually it's having a direct output.