I want to delete a Folder named "testfolder" and all the subfolders and files in it. I want to give the "testfolder" path as a parameter when calling the python file. For example ...... (testfolder location) and there it should delete the "testfolder" when the folder exists
Delete a specific folder with a path as a parameter in python
278 Views Asked by noggy At
3
You can use shutil.rmtree() for removing folders and argparse to get parameters.
You can save above script as 'remove.py' and call it from command prompt like: