Jun-26-2018, 09:31 AM
You can can try reading from
The problem is - it may get stuck. And what happens if the device never shows up?
I used to write
self.proc.stdout
till you get your device in the output - and then kill the process.for line in self.proc.stdout: if <> in line: self.proc.kill()(I think).
The problem is - it may get stuck. And what happens if the device never shows up?
I used to write
stdout
to a file stdout=open(<log name>, 'w')
- and then periodically look-up the file content in a loop, and leaving the loop after some maximum number of attempts.
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.