How do I return path to file if it exists in python

This question already has an answer here:

  • How to check whether a file exists? 39 answers

  • Invoke os.stat(filename) where filename can be a file or directory path. If the file exists, it will return a valid stat object. Otherwise, it throws a FileNotFound exception.

    链接地址: http://www.djcxy.com/p/7316.html

    上一篇: 安全地创建一个文件,当且仅当它不存在于python中

    下一篇: 如果它存在于python中,如何返回文件路径