Alex Waygood added the comment:
+1 for adding r"pip\s" as a special case as well. A few months ago, I was
trying to (remotely) help a beginner friend debug why his attempt to install a
library wasn't working. It took me ages before I realised he was entering it
into the interactive REPL
Andre Roberge added the comment:
I think that "trying to run a shell command" might not be easy to understand by
a beginner.
If the special case of r"python\s+" is added, perhaps r"pip\s+" should be
considered as well since many sites on the Internet suggest to install packages
using "pip
New submission from Steven D'Aprano :
A frequent newbie mistake is to call shell commands from inside the interactive
interpreter. Most common is to call Python itself.
Here is an example where a Python instructor was allegedly unable to diagnose
the issue for their students: