MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_play

Method do_play

tests/test_cmd2.py:1535–1540  ·  view source on GitHub ↗

Play your favorite musical instrument.

(self, arg)

Source from the content-addressed store, hash-verified

1533 self.stdout.write(result)
1534
1535 def do_play(self, arg) -> None:
1536 """Play your favorite musical instrument."""
1537 # Pass in an uneven list of tuples for selections
1538 instrument = self.select([("Guitar", "Electric Guitar"), ("Drums",)], "Instrument? ")
1539 result = f"Charm us with the {instrument}...\n"
1540 self.stdout.write(result)
1541
1542 def do_return_type(self, arg) -> None:
1543 """Test that return values can be non-strings"""

Callers

nothing calls this directly

Calls 2

selectMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected