Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/glob.rst

    r2 r391  
    1 
    21:mod:`glob` --- Unix style pathname pattern expansion
    32=====================================================
     
    98.. index:: single: filenames; pathname expansion
    109
     10**Source code:** :source:`Lib/glob.py`
     11
     12--------------
     13
    1114The :mod:`glob` module finds all the pathnames matching a specified pattern
    1215according to the rules used by the Unix shell.  No tilde expansion is done, but
     
    1417matched.  This is done by using the :func:`os.listdir` and
    1518:func:`fnmatch.fnmatch` functions in concert, and not by actually invoking a
    16 subshell.  (For tilde and shell variable expansion, use
    17 :func:`os.path.expanduser` and :func:`os.path.expandvars`.)
     19subshell.  Note that unlike :func:`fnmatch.fnmatch`, :mod:`glob` treats
     20filenames beginning with a dot (``.``) as special cases.  (For tilde and shell
     21variable expansion, use :func:`os.path.expanduser` and
     22:func:`os.path.expandvars`.)
     23
     24For a literal match, wrap the meta-characters in brackets.
     25For example, ``'[?]'`` matches the character ``'?'``.
    1826
    1927
     
    4755   ['1.gif']
    4856
     57If the directory contains files starting with ``.`` they won't be matched by
     58default. For example, consider a directory containing :file:`card.gif` and
     59:file:`.card.gif`::
     60
     61   >>> import glob
     62   >>> glob.glob('*.gif')
     63   ['card.gif']
     64   >>> glob.glob('.c*')
     65   ['.card.gif']
    4966
    5067.. seealso::
Note: See TracChangeset for help on using the changeset viewer.