Dec-29-2019, 07:15 AM
There is so many .wav files and create alot of these files everyday on Linux Host. I want to find all wav files that created yesterday ( a day ago when script run )on subdirectories and convert them to mp3 format with python script. I run os.walk ( path ) for finding '.wav' files but can not check that they was create yesterday.
Your answers can help alot.
Thanks in advance
1 2 3 4 5 6 |
for root, dir , files in os.walk(path): for file in files: if file .endswith( '.wav' ): wav = root + '/' + str ( file ) cmd = 'lame --preset insane %s' % wav subprocess.call(cmd, shell = True ) |
Thanks in advance