Skip to content

Instantly share code, notes, and snippets.

@jb0hn
jb0hn / rotatepdf.py
Last active August 29, 2024 13:37
Rotate PDF file with PyPDF2
#!/usr/bin/env python3
import PyPDF2
pdfIn = open('original.pdf', 'rb') # exchange the 'original.pdf' with a name of your file
pdfReader = PyPDF2.PdfFileReader(pdfIn)
pdfWriter = PyPDF2.PdfFileWriter()
for pageNum in range(pdfReader.numPages):
page = pdfReader.getPage(pageNum)
import requests
from bs4 import BeautifulSoup
headers = {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
}
login_data = {
'name': '<username>',
'pass': '<password>',
@miku
miku / .gitignore
Last active March 9, 2022 14:59
Word segmentation in a nutshell.
*gz