I attempted to build a python "pdf envelope" script. I'm using the pypdf library to attempt to take the first command line argument as name of new file to be created, and subsequent arguments as the files to be merged into an "envelope" pdf. from pypdf import PdfWriter import sys new_envelope = sys.argv[1] files = sys.argv[2:] def pdf_combiner(file_list): merger = PdfWriter() for pdf in file_list: merger.append(pdf) with open(new_envelope, "wb") as envelope: merger.write(envelope) merger.close() try: pdf_combiner(files) except Exception as err: print(f'Error: {err}') print('''Please try again. Input format should be new pdf envelope name followed by PDF files to be added to envelope. Note: All input PDF files must be in the current working directory. Example command: python3 pdf_envelope.py avengers.pdf thor.pdf iron_man.pdf hulk.pdf ''') Command from proper working directory: python3 ../pdf_envelope.py exenvelope.pdf combinedtest.pdf envelopetest1.pdf The code runs without errors. I expected a new pdf file to be created in the current folder, but the code produces no result. Why is that and how can I fix it? Continue reading...