提问人:David Jackson 提问时间:2/10/2020 更新时间:2/10/2020 访问量:53
在 python 的当前工作目录中查找具有特定名称的文件是否存在
Find if the file with specific name exists in the current working directory in python
问:
如何检查python当前工作目录中是否存在具有特定名称的文件? 我尝试关注但出现错误
import os
os.path.abspath(os.getcwd()).isfile('xyz.csv')
答:
0赞
johnramsden
2/10/2020
#1
import os
os.path.exists(os.path.join(os.path.abspath(os.getcwd()), 'xyz.csv')
上一个:Python 拆分行和列
下一个:如何在面包屑中显示层次结构
评论