Command-line wildcard expansion on Win32

Norbert norbert at bcssc.neca.nec.com.au
Sun Nov 5 21:57:22 EST 2000


I have created a module called "expand.py" which expands the command line
arguments in "sys.argv" using "glob.glob()". This module works okay, the
only disadvantage is that each python script must explicitly import
"expand.py".

I then renamed "expand.py" to "sitecustomize.py" and copied it to
"C:\Program Files\Python20\Lib". My "sitecustomize.py" is executed whenever
I run a python script but produces an error. The problem is that "sys.argv"
is not defined when "sitecustomize.py" is executed, i.e.
"hasattr(sys,'argv')" returns 0.

Is there a way to expand command-line wildcard arguments without having to
import a module in every python script?

Thanks.

Norbert





More information about the Python-list mailing list