Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your list has a tuple as its first element. To grab the tuple, just you need to get the 0-th element from the list:

>>> data = [(‘filename1’,
...         ‘filename2’, 
...          ...)]
>>> filenames = data[0]
>>> print filenames
(‘filename1’,
 ‘filename2’, 
 ...)

As tuples can't be altered once they have been created, if you want to change the data in the tuple, you will need to convert it to a list first:

>>> filenames = list(filenames)
>>> print filenames
[‘filename1’,
 ‘filename2’, 
 ...]