I'm trying to find out what is the best way to use the wild cards in Python. I'm trying to migrate this piece of .ks code to .py. If any file in a folder exists. I was thinking using these alternatives like: glob os.path.exists = but this will turn true or false os.path.isfile len? Here is part my code.
#this is .ks
fail_flag=0
#Checking more than one file of any kind
files=$(ls /opt/flag/*)
for file in $file
do
if [ -f $file ] ; then
fail_flag=1
fi
done