Eat something, with a selection of sauces to choose from.
(self, arg)
| 1509 | |
| 1510 | class SelectApp(cmd2.Cmd): |
| 1511 | def do_eat(self, arg) -> None: |
| 1512 | """Eat something, with a selection of sauces to choose from.""" |
| 1513 | # Pass in a single string of space-separated selections |
| 1514 | sauce = self.select("sweet salty", "Sauce? ") |
| 1515 | result = "{food} with {sauce} sauce, yum!" |
| 1516 | result = result.format(food=arg, sauce=sauce) |
| 1517 | self.stdout.write(result + "\n") |
| 1518 | |
| 1519 | def do_study(self, arg) -> None: |
| 1520 | """Learn something, with a selection of subjects to choose from.""" |