0

I am creating a python script that uses PyPdf2. I am trying to open and append a file using a wild card in the file name. It is taking the * literally in the file name.

Is there a way to declare wildcards with the open and merge functionality in PyPdf2? And if so, how?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
user12059
  • 733
  • 2
  • 13
  • 27

1 Answers1

2

Why not use the glob.glob function to find the list of matching files, then append each individually? That is a far cleaner separation of concerns than expecting PyPDF to guess when you mean a literal filename and when you mean a wildcard.

Jason Scheirer
  • 1,668
  • 16
  • 14