What's the best way to delete all files and dirs inside a folder without deleting the folder itself using python? Using:
if os.path.exists("path/to/folder"):
shutil.rmtree("path/to/folder/*")
Won't to the trick since the rmtree() doesn't understand UNIX style (/*). rmtree itself is fine, but it deleted the folder too, which I don't need.