From 7502af888f1571150be708da6a8de294e9453a34 Mon Sep 17 00:00:00 2001 From: Marco Buttu Date: Sat, 16 Jul 2022 04:10:19 +0200 Subject: Tutorial sys.argv example should not have interactive prompt (GH-94880) --- Doc/tutorial/stdlib.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst index b32a552..4f5ada9 100644 --- a/Doc/tutorial/stdlib.rst +++ b/Doc/tutorial/stdlib.rst @@ -65,11 +65,15 @@ Command Line Arguments Common utility scripts often need to process command line arguments. These arguments are stored in the :mod:`sys` module's *argv* attribute as a list. For -instance the following output results from running ``python demo.py one two -three`` at the command line:: +instance, let's take the following :file:`demo.py` file:: + + # File demo.py + import sys + print(sys.argv) + +Here is the output from running ``python demo.py one two three`` at the command +line:: - >>> import sys - >>> print(sys.argv) ['demo.py', 'one', 'two', 'three'] The :mod:`argparse` module provides a more sophisticated mechanism to process -- cgit v0.12