Created
October 12, 2015 02:40
-
-
Save naojitaniguchi/46ca96cca849dcea3641 to your computer and use it in GitHub Desktop.
Select file from image sequence and rename copy to destination directory .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'tani' | |
import shutil | |
if __name__ == '__main__': | |
start = 1 | |
end = 1324 | |
step = 5 | |
copy_from = "form/" | |
copy_to = "to/" | |
in_filename_head = "out_" | |
out_filename_head = "item_00_" | |
file_step = (end / 360.0) | |
count = 360 / step | |
# print file_step | |
for i in range(0, 360, step): | |
seq_number = int(i * file_step) | |
in_file_seq = "{0:0>4}".format(seq_number+1) | |
out_file_seq = "{0:0>4}".format(i/step) | |
copy_from_filename = copy_from + in_filename_head + in_file_seq + ".jpg" | |
copy_to_filename = copy_to + out_filename_head + out_file_seq + ".jpg" | |
shutil.copyfile(copy_from_filename, copy_to_filename) | |
print copy_from_filename + " to " + copy_to_filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment