Created
May 21, 2017 03:43
-
-
Save lattice0/d9d882ecdf6611e5933bb6a61729ab31 to your computer and use it in GitHub Desktop.
Script that joins photos from scanned book that gets 2 pages scanned at the same time
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
import os | |
def pick2(n): | |
pages.append(a[n]) | |
pages.append(b[n]) | |
def concatenate_list_data(list): | |
result= '' | |
for element in list: | |
result = result + " " + str(element) | |
return result | |
pages = [] | |
max1 = 285+1 | |
max2 = 574+1 | |
a = list(range(1,max1)) | |
b = list(range(max1+1,max2)) | |
a.reverse() | |
b.reverse() | |
#print(a) | |
c = [pick2(n) for n in range(min(len(a),len(b)))] | |
file_names = [("Analise\ Real\ Elon\ Duplicado_"+str(pages[n])+".jpg") for n in range(len(pages))] | |
terminal_command = "convert" + concatenate_list_data(file_names) + " output.pdf" | |
os.system(terminal_command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment