Skip to content

Instantly share code, notes, and snippets.

@margath
margath / reverse_pdf_pages.py
Last active May 22, 2023 23:22
Quickly Reverse the pages in a PDF File using Python.
!pip install pypdf
from pypdf import PdfWriter, PdfReader
from pathlib import Path
file_name="file_name_of_pdf.pdf"
input_file=Path(F"/content/drive/MyDrive/{file_name}")
output_file=Path(F"/content/drive/MyDrive/0 {file_name}")
output_pdf = PdfWriter()
from datetime import datetime, timedelta
from typing import Iterable
from math import ceil
class DateTimeRange:
def __init__(self, start: datetime, end_:datetime, step:timedelta = timedelta(seconds=1)):
self._start = start
self._end = end_
self._step = step

Keybase proof

I hereby claim:

  • I am margath on github.
  • I am margath (https://keybase.io/margath) on keybase.
  • I have a public key ASAMY_8bwkCel2CEqMzsBmGr8n_ys19k4eSHvg1tOaQP1wo

To claim this, I am signing this object: