From 9e64f600b65d99ea5a83051372372512be698b1b Mon Sep 17 00:00:00 2001 From: kotfu Date: Fri, 5 Jul 2019 15:05:51 -0600 Subject: Added a walkthrough of constructing a simple application to the overview For #709 --- examples/example.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/example.py') diff --git a/examples/example.py b/examples/example.py index 24be5d5d..a62c258b 100755 --- a/examples/example.py +++ b/examples/example.py @@ -26,10 +26,9 @@ class CmdLineApp(cmd2.Cmd): MUMBLE_LAST = ['right?'] def __init__(self): - shortcuts = dict(cmd2.DEFAULT_SHORTCUTS) + shortcuts = cmd2.DEFAULT_SHORTCUTS shortcuts.update({'&': 'speak'}) - # Set use_ipython to True to enable the "ipy" command which embeds and interactive IPython shell - super().__init__(use_ipython=False, multiline_commands=['orate'], shortcuts=shortcuts) + super().__init__(multiline_commands=['orate'], shortcuts=shortcuts) # Make maxrepeats settable at runtime self.maxrepeats = 3 @@ -52,7 +51,7 @@ class CmdLineApp(cmd2.Cmd): word = word.upper() words.append(word) repetitions = args.repeat or 1 - for i in range(min(repetitions, self.maxrepeats)): + for _ in range(min(repetitions, self.maxrepeats)): # .poutput handles newlines, and accommodates output redirection too self.poutput(' '.join(words)) -- cgit v1.2.1