I want to remove dataset folder from dataset3 folder. But the following code is not removing dataset.
First I want to check if dataset already exist in dataset then remove dataset.
Can some one please point out my mistake in following code?
for files in os.listdir("dataset3"):
if os.path.exists("dataset"):
os.system("rm -rf "+"dataset")
files
filename and even if you did, you need to add the original path ('dataset3') to it. – Podagraos.system("rm -rf dataset3/dataset")
does the job. – Podagra