Scheduling such that pictures get deleted from the rpi - Raspberry Pi Forums


hey guys,
new rpi , wondering if there's way schedule such whenever picture taken camera module, gets saved folder , when folder exceeds limit of 10 images, 5 oldest images deleted itself.
please guide me how that?
appreciated.

:)

ok! so... dont know camera api can detecting the 5 oldest photos :d
ok every time take photo use (make shure py file located in same folder or place full path of line 3 *):

code: select all

import glob import os photosarray = glob.glob("*.png")# gets photos in imgs fold..* print photosarray if len(photosarray)>=9:#10 photos created?    print "yay lets start bubble sorting!"    #sort    alist = photosarray    passnum in range(len(alist)-1,0,-1):         in range(passnum):             if os.path.getmtime(alist[i])>os.path.getmtime(alist[i+1]):                 temp = alist[i]                 alist[i] = alist[i+1]                 alist[i+1] = temp     print photosarray    = 1        while(a<5):     	os.remove(photosarray[a])     	photosarray.remove(photosarray[a])     	a=a+1    print photosarray   def bubblesort(alist):     passnum in range(len(alist)-1,0,-1):         in range(passnum):             if os.path.getmtime(alist[i])>os.path.getmtime(alist[i+1]):                 temp = alist[i]                 alist[i] = alist[i+1]                 alist[i+1] = temp    
let me know if there problem cuz didnt compiled it...


raspberrypi



Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support