7.4. Adding Support for Wildcards

We now have a robust test harness for the xgrep module. It can be used both as a module in a larger program and as a standalone program. It gracefully handles the case where it has been invoked directly without any command-line parameters. The warning message it generates is sensible, even if the module filename is changed from xgrep.py to something else.

The next improvement we make will allow xgrep to process any number of command-line parameters—including command-line parameters that contain wildcards. If your computing platform is exclusively Unix, you may be wondering why this is necessary, given that the shell expands wildcards on behalf of the programs it executes. Well, although this is true on Unix, ...

Get XML Processing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.