I need to check the current directory and see if a file with an extension exists. My setup will (usually) only have one file with this extension. I need to check if that fil
You should use the glob module to look for exactly the files that you're interested in:
import glob fileList = glob.glob("*.true") for trueFile in fileList: doSomethingWithFile(trueFile)