I am modifying a wizard in Kodi and I would like the wizard to delete all folders contained within the "addons" directory without deleting my wizard.
The directory of the folder will be using the "special://" function built into Kodi. I would like to delete everything inside of "special://home/addons" except for the folder named "plugin.video.spartan0.12.0"
I know that python needs to use "xbmc.translatePath" function to recognize the folder path, but I don't know how to delete everything in the folder without deleting "plugin.video.spartan0.12.0"
Any help would be appreciated.
Here is what I currently have
import os
dirPath = "C:\Users\Authorized User\AppData\Roaming\Kodi\addons"
fileList = os.listdir(dirPath)
for fileName in fileList:
os.remove(dirPath+"/"+fileName)