Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
import sys, glob
# Collect the matching filenames here:
filenames = 
# Read one or more search patterns from the command line
for pattern in sys.argv[1:]:
# For each pattern, expand it into a list of filenames.
matches = glob.glob(pattern)
# Add these matches to the list of all the matching files.
# We now have our list of filenames.
# Example usage and output:
# > cd \temp
# > python ee-glob.py *.java test*
# ['Function.java', 'unescape.java', 'test.mbox', 'test.xls', 'TestApp.exe']
Open in new window
Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.