Reputation: 73
I want to make some montage in ImageMagick
which is called by Python via os.system()
with 100 jpegs files.
Here's the command:
cmd='montage '+file[i]+' '+file[i+1]+' '+file[i+2]+' '+file[u+3]+' +file[i+4]+'...+file[i+99]
I would like to know how could I avoid to write all file[i+x]
entries.
Is this possible?
Upvotes: 0
Views: 83
Reputation: 44464
To join 100 strings with a space starting at i
th index:
cmd = "montage " + " ".join(file[i:i+100])
.. where file[i:i+100]
will return a sub-sequence starting at i, and ending at (i + 100 - 1)
Upvotes: 5