I commonly use os.path.exists()
to check if a file is there before doing anything with it.
I\'ve run across a situation where I\'m calling a executable that
Please note that checking for existance and then opening is always open to race-conditions. The file can disappear between your program's check and its next access of the file, since other programs continue to run on the machine.
Thus there might still be an exception being thrown, even though your code is "certain" that the file exists. This is, after all, why they're called exceptions.