Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python2.7
- import os
- import glob
- def process_file(_, path, filelist):
- input_param = " ".join('"' + x + '"' for x in glob.glob(os.path.join(path, "*.pdf")))
- output_param = '"' + os.path.join(path, os.path.basename(path) + ".pdf") + '"'
- cmd = "pdftk " + input_param + " cat output " + output_param
- print cmd
- #os.system(cmd)
- def files_recursively(topdir):
- os.path.walk(os.path.realpath(topdir), process_file, ())
- if __name__ == "__main__":
- files_recursively(os.getcwd())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement