cmd2
cmd2 copied to clipboard
Is there a way to input some text to prompt to mimic a user input
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.