J.A.R.V.I.S
J.A.R.V.I.S copied to clipboard
Display the commands on GUI of JARVIS
We can see at now the commands are visible on the terminal but not on the GUI of the JARVIS. The aim is to make the commands visible on the GUI of the JARVIS.
This snippet of code will allow you to capture console output
usage:
sys.stdout = Unbuffered(YourOutputStream, sys.stdout, OptionalEchoStream)
you may pass sys.stdout as both 2nd and 3rd params to capture output as well as
have it still output to consolse. You can use on sys.stderr also.
Restore normal operation:
sys.stdout = sys.stdout.restore()
class Unbuffered(object):
def __init__(self, stream_out, original, echo_out=None):
self.oout = original
self.sout = stream_out
self.eout = echo_out
def write(self, data):
if self.sout is not None:
self.sout.write(data)
if self.eout is not None:
self.eout.write(data)
def writelines(self, datas):
self.write(''.join(datas))
def flush(self):
pass
def restore(self):
return self.oout
Thanks for your interest @geneReeves, If you are interested in contributing you can make a PR and attach the working UI image.