Sponsored Content
Full Discussion: [python] merge pdf files.
Top Forums Programming [python] merge pdf files. Post 303039615 by Corona688 on Thursday 10th of October 2019 12:57:44 PM
Old 10-10-2019
Thanks. That statement looks redundant (it's never going to be run as not main) so maybe try this:

Code:
#pdf_merger.py

import glob
from PyPDF2 import PdfFileMerger

def merger(output_path, imput_paths):
    pdf_merger = PdfFileMerger()
    file_handles = []

    for path in input_paths:
        pdf_merger.append(path)

    with open(ouput_path, 'wb') as fileobj:
        pdf_merger.write(fileobj)

paths = glob.glob('MU3_*.pdf')
paths.sort()
merger('pdf_merger2.pdf', paths)

 

2 More Discussions You Might Find Interesting

1. Programming

Scipy Python/ get pdf

Hi all I'm just starting usign scipy with python, really powerfull. It comes with some many functions but I'm not able to solve my problem. I have an array x and i need to find a probability density function (pdf) from data. does anyone know how to do that? (i've done it evaluating first... (1 Reply)
Discussion started by: Dedalus
1 Replies

2. Shell Programming and Scripting

Merge PDF

Hi I am trying to find a software to merge several pdfs into one pdf on our solaris machine. After merging the document, I have to direct it to a printer. Does anyone have a recommendation? I try to contact a couple of vendor but no replies. Thanks. (5 Replies)
Discussion started by: lillyt2006
5 Replies
SYSTEMD-PATH(1) 						   systemd-path 						   SYSTEMD-PATH(1)

NAME
systemd-path - List and query system and user paths SYNOPSIS
systemd-path [OPTIONS...] [NAME...] DESCRIPTION
systemd-path may be used to query system and user paths. The tool makes many of the paths described in file-hierarchy(7) available for querying. When invoked without arguments, a list of known paths and their current values is shown. When at least one argument is passed, the path with this name is queried and its value shown. The variables whose name begins with "search-" do not refer to individual paths, but instead to a list of colon-separated search paths, in their order of precedence. OPTIONS
The following options are understood: --suffix= The printed paths are suffixed by the specified string. -h, --help Print a short help text and exit. --version Print a short version string and exit. EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. SEE ALSO
systemd(1), file-hierarchy(7) systemd 237 SYSTEMD-PATH(1)
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy