I am running Python 3
on a Windows machine using PowerShell
. I am trying to execute a Python file and then pass a number of files (file1.html, file2.html, etc.) as arguments using a wildcard character. I can get this to work, performing a couple of steps like below:
PS $files = Get-Item .\file*.html
PS python mypythonfile.py $files
My question is can this be done without having to use Get-Item
and assigning the results to a variable? I tried running the same file like this python mypythonfile.py .\file*.html
but this results in an error from the Python interpreter because PowerShell doesn't parse out the wildcard and passes the string with the wildcard.