Using to delete files from temp folder on startup

Hi, i can manually delete files in my osmc .kodi folder by using ssh at command line:
rm .kodi/temp/*.fi

I want to automate this at startup and have added an file to my .kodi/userdata folder

import os

## if file exists, delete it ##
if os.path.isfile(myfile):
else:    ## Show an error ##
    print("Error: %s file not found" % myfile)

On reboot the files are not deleted

Could someone help ?

Your path to the folder is not correct.
Rather than /.kodi it should be something like /usr/osmc/.kodi - but double check from command line to be sure.

I’ve resolved my issue with a revised

import glob
for fl in glob.glob("home/osmc/.kodi/temp/*.fi"):