Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Lib/shlex.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,14 @@ def split(s, comments=False, posix=True):


def join(split_command):
"""Return a shell-escaped string from *split_command*."""
"""Return a shell-escaped string from *split_command*.

This function is the inverse of :func:`split`.

>>> import shlex
>>> print(shlex.join(['echo', '-n', 'Multiple words']))
echo -n 'Multiple words'
"""
return ' '.join(quote(arg) for arg in split_command)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add examples to :func:`shlex.join` docstring.
Loading