(Jun-27-2018, 05:59 AM)maffaz Wrote: Interesting! That is golden advice even if it does not work..
The ping example works fine with stdout but not the tool in question.
I am not at my computer until this evening and I will try it then but that is certainly something I have not tried as of yet!
I must stress that it is a windows CLI Tool but the beauty of subprocess is that it is cross platform.
Is there anything to consider if its windows?
Did you try to set
stderr=subprocess.STDOUT
? Some apps send output to stderr
- don't ask me why, but I saw it happening, especially with HW-oriented apps.One more thing I have forgotten (I haven't used
subprocess
for several months) - by default its output is bytestrings
, universal_newlines=True
forces its output to unicode strings.If you run your command in terminal, does it provide continuous output - or only after you stop it? In the former case, my approach should work
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.