I run my script with doc1/*.png
as first argument, but it gets converted to doc1/image1.png
.
How can I let Python see the exact argument?<
On most linux shells (bash
, sh
, fish
,...), the asterisk is handled by the shell. The fact that the *
is converted to a list of files is already done at the shell level.
If you write:
python file.py doc/*.png
The shell itself will translate doc/*.png
into "doc/1.png" "doc/2.png"
(so a list of .png
files it finds in the doc
directory.
You should use quotes to pass the asterisk, like:
python file.py 'doc/*.png'
The standard Windows shell does not do wildcards for file names.