Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the commands on GUI of JARVIS #5

Open
BolisettySujith opened this issue May 26, 2021 · 2 comments
Open

Display the commands on GUI of JARVIS #5

BolisettySujith opened this issue May 26, 2021 · 2 comments
Labels
Medium Something which will take some time, but little hard

Comments

@BolisettySujith
Copy link
Owner

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.

@BolisettySujith BolisettySujith added the Medium Something which will take some time, but little hard label May 26, 2021
@geneReeves
Copy link

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

@BolisettySujith
Copy link
Owner Author

Thanks for your interest @geneReeves, If you are interested in contributing you can make a PR and attach the working UI image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Something which will take some time, but little hard
Projects
None yet
Development

No branches or pull requests

2 participants