I am trying to find the full real path on Windows, based on a path with the *
character in it (which seems to be something similar to a regular expression).
For instance, if in a Windows console I do:
cd C:\\Windows\\Program Files\\MySWv1*\\bin
the above path is expanded in something like:
C:\\Windows\\Program Files\\MySWv1.90\\bin
and then the cd
command is executed successfully.
However, if in Python (2.7) I try to execute the following:
import os
my_path = 'C:\\Windows\\Program Files\\MySWv1*\\bin'
os.path.exists(my_path)
This returns False
.
How can I make the above script returns True
?