如何在Python中删除文件或文件夹?
python directory file-io delete-file
我想删除该文件(filename如果存在).这是否合适
filename
if os.path.exists(filename): os.remove(filename)
有没有更好的办法?单行方式?
python
python ×2
delete-file ×1
directory ×1
file-io ×1