I have lots of files that I use glob.glob to sort them to plot. My files are ordered by number: lets say from file.00000 to file.99999.
I use:
filenames = sorted(glob.glob('path/file.*'))
this_next = filenames
for i, fname1 in enumerate(this_next):
…
Now I would like to plot every 90 files.
filenames
andthis_next
? The enumeration is a non-destructive operation. Are you also after an index number (so you'd get(1, 'file.00000')
and then(91, 'file.00090')
, etc)?file.00000
tofile.99999
'; your comment gives a different structure for the file names (file1_0.00001
,file20.00001
). This is confusing to those trying to help you. So, in your enumeration clause, what ends up ini
and what ends up infname1
?