File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -354,14 +354,20 @@ functions.
354
354
arguments for additional differences from the default behavior. Unless
355
355
otherwise stated, it is recommended to pass *args * as a sequence.
356
356
357
+ An example of passing some arguments to an external program
358
+ as a sequence is::
359
+
360
+ Popen(["/usr/bin/git", "commit", "-m", "Fixes a bug."])
361
+
357
362
On POSIX, if *args * is a string, the string is interpreted as the name or
358
363
path of the program to execute. However, this can only be done if not
359
364
passing arguments to the program.
360
365
361
366
.. note ::
362
367
363
- :meth: `shlex.split ` can be useful when determining the correct
364
- tokenization for *args *, especially in complex cases::
368
+ It may not be obvious how to break a shell command into a sequence of arguments,
369
+ especially in complex cases. :meth: `shlex.split ` can illustrate how to
370
+ determine the correct tokenization for *args *::
365
371
366
372
>>> import shlex, subprocess
367
373
>>> command_line = input()
You can’t perform that action at this time.
0 commit comments