I'm developing a webbased controller for robots. When I run a command like os.system('cd /home/tim/tmprcc/; ino build; ino upload')
, I need to be able to send the output to the web app. How do I capture the output during execution in Python? The user needs to be able to see the output live as it is showing on my terminal.
Your answer should have Python code that calls do_something_function(new_output)
every time a line of output appears, where new_output is the entire output generated so far.