If it is not possible to create this list without loops, I’d be content just to minimize the time it takes to create this list. The goal is to create a two-dimensional array with the filenames for 100 pdf files in each of 10 or so folders. Tell me what you think:
foldernames = [
'Named_folder00/',
'Named_folder01/',
'Named_folder02/',
'Named_folder03/',
'Named_folder04/',
'Named_folder05/',
'Named_folder06/',
'Named_folder07/',
'Named_folder08/',
'Named_folder09/',
]
pages = []
for b in xrange(len(foldernames)):
pg_temp = [
foldernames[b] + 'title1',
foldernames[b] + 'title2',
foldernames[b] + 'title3'
]
pg_temp += [ foldernames[b] + '0' + str(j) for j in xrange(1,10) ]
pg_temp += [ foldernames[b] + str(k) for k in xrange(10,100) ]
for c in xrange(len(pg_temp)):
pg_temp[c] += '.pdf'
pages.append(pg_temp)
Note: I have no idea how fast it is, didn’t benchmark it.