cmd2 icon indicating copy to clipboard operation
cmd2 copied to clipboard

Is there a way to input some text to prompt to mimic a user input

Open zhouhao27 opened this issue 1 year ago • 0 comments

For example, I have the following code:

def do_job1(self, text):
    # do job1

def do_job2(self, text):
    # do job2

def default(self, text):
    # not a command, it's some text in the command line

Now I want to add some code in do_job1. After I finish job1, I want to mimic keying some text and return in command line so that the default is called. The reason I don't want to call default directly is because I want to show those text in prompt.

Any idea? Thanks.

zhouhao27 avatar Jun 28 '24 13:06 zhouhao27