I'm trying to filter a tuple as follows...some code not included for brevity:
1) print >> sys.stderr, "audio", audio
2) print >> sys.stderr, "audio[0]", audio[0]
3) print >> sys.stderr, "audio[1]", audio[1]
4) audio_lang = filter(lambda a: a[1]==LANG, audio)
It is being passed a tuple with 2 elements, the run is as follows:
D:\Staging\Test>cleanMKV.py .
audio [('fre',), ('eng',)]
audio[0] ('fre',)
audio[1] ('eng',)
Traceback (most recent call last):
File "D:\Staging\Test\cleanMKV.py",
audio_lang = filter(lambda a: a[1]
File "D:\Staging\Test\cleanMKV.py",
audio_lang = filter(lambda a: a[1]
IndexError: tuple index out of range
The tuple was created properly with RE and I'm at a point I want to filter as shown on line 4. It is trying to reference the audio a[1] in audio.
Any help appreciated.
filterdoes?