Delete files in directories with python script

I am a new user of hassio and do not know much about Python programming. I tried a Python script to delete the .jpg image files. The code I use is as follows:

import glob
import os
filelist = glob.glob ('/ config / www / deepstack_person_images / deepstack_person _ *. jpg')
for file in filelist:
   os.remove (file)

It runs fine on Win but do not work with hassio. Look forward to the help of everyone. I need to delete files older than the current date one day. Sincerely thank you

i also need to delete the same, did you have a solation?

I have not found a way yet. Hope to help someone soon :grinning:

Anyone get this working or another method?