Python · Useful Modules & Recipes

In a cmd.Cmd console, how do you provide per-command help text that appears for 'help date' or '? date'?

Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.

Get it on App StoreGet it on Google Play

This is one card from the KnowCard library — thousands more across SAP, Linux, Python and more. In the app you get the answer, AI explanations, and cards that come back right before you would forget them. Free to start on iOS, Android or the web.

More in Useful Modules & Recipes

You want to open a help page in the user's actual default browser from a script, with no GUI dependency. What does the standard library give you?
Your CLI prompts for a password with input(). A reviewer flags it as a security bug. Why, and what's the fix?
What's the difference in what gets shown on screen between getpass.getpass() and input() while the user types?
Which function returns the login name of the current OS user, without you parsing environment variables yourself?
What kind of object is a generator that uses value = (yield) rather than yield expr?
What does this print? ``` def printer(): while True: v = (yield) print(v) p = printer() p.send(87) ```

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play