我正在尝试删除运行 Python 程序的目录中的某个文件。
def erase_custom_file():
directory=os.listdir(os.getcwd())
for somefile in directory:
if somefile=="file.csv":
os.remove(???)
我不确定我的下一步应该是什么。我知道这os.remove
需要一个参数的路径,但我不确定如何将它定向到我想要的文件。请帮帮我?