I have a list full of filepaths to mp3 files.
print ("/home/jds/Music/Other Songs/Supernatural.mp3" in mp3_files) #prints True
for f in mp3_files:
if '/home/jds/Music/Other Songs/Supernatural.mp3' == f :
print "Gotcha"
mp3 = eyed3.load( f )
if mp3.tag is None: #check if mp3 file has id3
print f + " is None"
mp3_files.remove( f ) #no id3, remove from list!!
This code above prints "True" and some filepaths. This specific file has no id3 so the if statement should be true and this filepath should later not exist anymore. Somehow it is still in the list and causes a crash later.
Well, first I check if that filepath is in the list and I get as output "True", so it is in there. Then I go through every filepath in the list and if that filepath is reached it should print "Gotcha". However, it doesn't! What's wrong?!
Edit:
I removed the part after the if statement in the for loop to test something and now I get the output "Gotcha".
print ("/home/jds/Music/Other Songs/Supernatural.mp3" in mp3_files) #prints True
for f in mp3_files:
if '/home/jds/Music/Other Songs/Supernatural.mp3' == f :
print "Gotcha"